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

Unified Diff: third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter.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-native-nodes-filter.html
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter.html
index 4d205351a20699e40d5caf76fde8dc4a2a8db936..f715e10c0dc142f62249e357056f55a32646126b 100644
--- a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter.html
+++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-native-nodes-filter.html
@@ -128,6 +128,7 @@ function test()
"endTime": 100000 + 111.110 + 22.220 + 1.000,
"samples": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
};
+ profile.nodes = flattenNodes(profile.head);
var model = new WebInspector.CPUProfileDataModel(profile);
printTree("", model.profileHead);
function printTree(padding, node)
@@ -137,6 +138,13 @@ function test()
}
InspectorTest.addResult(model.samples.join(", "));
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