| Index: tracing/tracing/ui/analysis/memory_dump_heap_details_pane_test.html
|
| diff --git a/tracing/tracing/ui/analysis/memory_dump_heap_details_pane_test.html b/tracing/tracing/ui/analysis/memory_dump_heap_details_pane_test.html
|
| index c2c742e3e191921bd61666c0b8adb4285f611d29..9998aaf3296001468efdb0ebce0ff2850c7ca88d 100644
|
| --- a/tracing/tracing/ui/analysis/memory_dump_heap_details_pane_test.html
|
| +++ b/tracing/tracing/ui/analysis/memory_dump_heap_details_pane_test.html
|
| @@ -181,6 +181,34 @@ tr.b.unittest.testSuite(function() {
|
| return [hd1, hd2];
|
| }
|
|
|
| + function createSelfHeapDumps(withCount) {
|
| + const model = new tr.Model();
|
| + const process = model.getOrCreateProcess(1);
|
| +
|
| + function addHeapEntry(heapDump, stackFrames, objectTypeName, size, count) {
|
| + const leafStackFrame = stackFrames === undefined ? undefined :
|
| + tr.c.TestUtils.newStackTrace(model, stackFrames);
|
| + heapDump.addEntry(leafStackFrame, objectTypeName, size,
|
| + withCount ? count : undefined, false /* valuesAreTotals */);
|
| + }
|
| +
|
| + // First timestamp.
|
| + const gmd1 = addGlobalMemoryDump(model, {ts: -10});
|
| + const pmd1 = addProcessMemoryDump(gmd1, process, {ts: -11});
|
| + const hd1 = new HeapDump(pmd1, 'partition_alloc');
|
| + hd1.isComplete = true;
|
| +
|
| + addHeapEntry(hd1, ['MessageLoop::RunTask', 'a', 'AllocSomething'],
|
| + 'v8::Context', 1024, 100);
|
| + addHeapEntry(hd1, ['MessageLoop::RunTask', 'a', 'b', 'AllocSomething'],
|
| + 'v8::Context', 1024, 100);
|
| + addHeapEntry(hd1, ['MessageLoop::RunTask', 'a', 'b', 'c', 'AllocSomething'],
|
| + 'v8::Context', 1024, 100);
|
| +
|
| + return [hd1];
|
| + }
|
| +
|
| +
|
| function checkDisplayedElements(viewEl, displayExpectations) {
|
| assert.strictEqual(isElementDisplayed(viewEl.$.info_text),
|
| displayExpectations.infoText);
|
| @@ -3989,5 +4017,29 @@ tr.b.unittest.testSuite(function() {
|
| }
|
| ]);
|
| });
|
| +
|
| + test('instantiate_selfHeapSingle', function() {
|
| + const heapDumps = createSelfHeapDumps(true).slice(0, 1);
|
| +
|
| + const viewEl = tr.ui.analysis.createTestPane(
|
| + 'tr-ui-a-memory-dump-heap-details-pane');
|
| + viewEl.heapDumps = heapDumps;
|
| + viewEl.rebuild();
|
| + this.addHTMLOutput(viewEl);
|
| +
|
| + // Top-down tree view (default).
|
| + checkSplitView(viewEl,
|
| + { expectedCountColumns: true },
|
| + [
|
| + {
|
| + dimension: ROOT,
|
| + title: 'partition_alloc',
|
| + size: [1024 * 3],
|
| + count: [300],
|
| + defined: [true],
|
| + children: 2 // No need to check the full structure again.
|
| + }
|
| + ]);
|
| + });
|
| });
|
| </script>
|
|
|