Index: third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/console-profile.html |
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/console-profile.html b/third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/console-profile.html |
index 2df66b4aa33fdef4f08a0b106bff6dae67509b70..c66013ee8d0f4ecc9e03e1d6ce557d1859f32c39 100644 |
--- a/third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/console-profile.html |
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/console-profile.html |
@@ -46,22 +46,15 @@ function test() |
function checkInnerProfile(profile) |
{ |
InspectorTest.log("SUCCESS: retrieved '42' profile"); |
- var root = profile.head; |
- if (!findFunctionInProfile(root, "collectProfiles")) |
+ if (!findFunctionInProfile(profile.nodes, "collectProfiles")) |
return InspectorTest.fail("collectProfiles function not found in the profile: " + JSON.stringify(profile, null, 4)); |
InspectorTest.log("SUCCESS: found 'collectProfiles' function in the profile"); |
InspectorTest.completeTest(); |
} |
- function findFunctionInProfile(node, functionName) |
+ function findFunctionInProfile(nodes, functionName) |
{ |
- if (node.callFrame.functionName === functionName) |
- return true; |
- var children = node.children; |
- for (var i = 0; i < children.length; ++i) |
- if (findFunctionInProfile(children[i], functionName)) |
- return true; |
- return false; |
+ return nodes.some(n => n.callFrame.functionName === functionName); |
} |
} |
</script> |