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