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

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

Issue 2635023002: [tracing] Support new heap dump format (Closed)
Patch Set: remove it again Created 3 years, 9 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
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 16680412b6514a7bb8d19c3c57056c35f2ab41ea..74efb9ce9bdb159164f364e94686dd9c1a3730a8 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
@@ -180,6 +180,34 @@ tr.b.unittest.testSuite(function() {
return [hd1, hd2];
}
+ function createSelfHeapDumps(withCount) {
+ var model = new tr.Model();
+ var process = model.getOrCreateProcess(1);
+
+ function addHeapEntry(heapDump, stackFrames, objectTypeName, size, count) {
+ var leafStackFrame = stackFrames === undefined ? undefined :
+ tr.c.TestUtils.newStackTrace(model, stackFrames);
+ heapDump.addEntry(leafStackFrame, objectTypeName, size,
+ withCount ? count : undefined, true /* valuesAreSelf */);
+ }
+
+ // First timestamp.
+ var gmd1 = addGlobalMemoryDump(model, {ts: -10});
+ var pmd1 = addProcessMemoryDump(gmd1, process, {ts: -11});
+ var 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);
@@ -3988,5 +4016,29 @@ tr.b.unittest.testSuite(function() {
}
]);
});
+
+ test('instantiate_selfHeapSingle', function() {
+ var heapDumps = createSelfHeapDumps(true).slice(0, 1);
+
+ var 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>

Powered by Google App Engine
This is Rietveld 408576698