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> |