Hook up stacktraces to leak notification

Summary: Transfer it from the device, reformat the notification to make use of it.

Reviewed By: danielbuechele

Differential Revision: D15779267

fbshipit-source-id: 747dc7f895528618ff6a07c15b7f72bf6a1adde9
This commit is contained in:
Pascal Hartig
2019-06-13 11:15:01 -07:00
committed by Facebook Github Bot
parent 6168b3c604
commit 71575ce7cf
4 changed files with 38 additions and 3 deletions

View File

@@ -265,10 +265,12 @@ test('closeable reference metrics on input', () => {
{
identityHashCode: 'deadbeef',
className: 'com.facebook.imagepipeline.memory.NativeMemoryChunk',
stacktrace: null,
},
{
identityHashCode: 'f4c3b00c',
className: 'com.facebook.flipper.SomeMemoryAbstraction',
stacktrace: null,
},
];
const persistedState = {
@@ -287,10 +289,12 @@ test('notifications for leaks', () => {
{
identityHashCode: 'deadbeef',
className: 'com.facebook.imagepipeline.memory.NativeMemoryChunk',
stacktrace: null,
},
{
identityHashCode: 'f4c3b00c',
className: 'com.facebook.flipper.SomeMemoryAbstraction',
stacktrace: null,
},
];
const persistedStateWithoutTracking = {
@@ -308,6 +312,6 @@ test('notifications for leaks', () => {
};
const notifs = notificationReducer(persistedStateWithTracking);
expect(notifs).toHaveLength(2);
expect(notifs[0].message).toContain('deadbeef');
expect(notifs[0].message).toMatchSnapshot();
expect(notifs[1].title).toContain('SomeMemoryAbstraction');
});