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

Unified Diff: third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html

Issue 2244783004: DevTools: Refactor Profiler domain interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html
index 61cd7f20cfbfebe08214afe3c0c867c77d3e567f..b0c93b7bba53e2fd61986ada2129e62fe597de22 100644
--- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html
+++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-flame-chart-overview.html
@@ -931,6 +931,7 @@ function test()
var profile = profileAndExpectations._profile;
var startTime = profile.startTime * 1000;
var endTime = profile.endTime * 1000;
+ profile.nodes = flattenNodes(profile.head);
profile.startTime /= 1000;
profile.endTime /= 1000;
var samplingInterval = (endTime - startTime) / (profile.samples.length - 1);
@@ -949,6 +950,14 @@ function test()
console.log(Object.values(overviewPane._calculateDrawData(2)));
console.log(Object.values(overviewPane._calculateDrawData(1)));
InspectorTest.completeTest();
+
+ function flattenNodes(node)
+ {
+ var childrenIds = node.children.map(n => n.id);
+ var result = node.children.reduce((res, n) => res.concat(flattenNodes(n)), [node]);
+ node.children = childrenIds;
+ return result;
+ }
}
</script>

Powered by Google App Engine
This is Rietveld 408576698