Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: tracing/tracing/ui/analysis/memory_dump_heap_details_pane_test.html

Issue 2635023002: [tracing] Support new heap dump format (Closed)
Patch Set: fix bug''fix bug Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/tracing/ui/analysis/memory_dump_heap_details_pane.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « tracing/tracing/ui/analysis/memory_dump_heap_details_pane.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698