Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-deep-nesting.html |
| diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-deep-nesting.html b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-deep-nesting.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..51e6f91983719ea4279e535f62a8ce025b9bbb7e |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/inspector/profiler/cpu-profiler-deep-nesting.html |
| @@ -0,0 +1,36 @@ |
| +<html> |
| +<head> |
| + <script src="../../http/tests/inspector/inspector-test.js"></script> |
| + <script src="profiler-test.js"></script> |
| +<script> |
| + |
| +function test() |
| +{ |
| + InspectorTest.runProfilerTestSuite([ |
| + function testDeepProfile(next) |
| + { |
| + function findPageFunctionInProfileView(view) |
| + { |
| + InspectorTest.addResult(`Max profile tree depth: ${maxDepth(view.profile.root)}`); |
| + next(); |
| + } |
| + function maxDepth(node) |
| + { |
| + return Math.max.apply(Math, node.children.map(maxDepth).concat(0)) + 1; |
| + } |
| + InspectorTest.showProfileWhenAdded("profile"); |
| + InspectorTest.waitUntilProfileViewIsShown("profile", findPageFunctionInProfileView); |
| + InspectorTest.evaluateInPage("f = d => d ? f(d - 1) : console.profile('profile'); f(1000); console.profileEnd('profile');", () => 0); |
|
pfeldman
2016/05/28 01:43:14
Lets test what you fix.
alph
2016/05/28 02:21:52
Redone everything.
|
| + } |
| + ]); |
| +} |
| + |
| +</script> |
| +</head> |
| +<body onload="runTest()"> |
| +<p> |
| +Tests that CPU profiler can retrieve deeply nested profile trees. |
| + |
| +</p> |
| +</body> |
| +</html> |