| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 | 5 |
| 6 if (window.testRunner) { | 6 if (window.testRunner) { |
| 7 testRunner.dumpAsText(); | 7 testRunner.dumpAsText(); |
| 8 testRunner.waitUntilDone(); | 8 testRunner.waitUntilDone(); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 var head = profile.head; | 51 var head = profile.head; |
| 52 logNode(findNode(head, "testMain", 1)); | 52 logNode(findNode(head, "testMain", 1)); |
| 53 logNode(findNode(head, "makeDeepCallStack", 11)); | 53 logNode(findNode(head, "makeDeepCallStack", 11)); |
| 54 logNode(findNode(head, "junkGenerator", 12)); | 54 logNode(findNode(head, "junkGenerator", 12)); |
| 55 | 55 |
| 56 InspectorTest.completeTest(); | 56 InspectorTest.completeTest(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 function findNode(root, name, depth) | 59 function findNode(root, name, depth) |
| 60 { | 60 { |
| 61 if (depth < 1 && root.functionName === name) | 61 if (depth < 1 && root.callFrame.functionName === name) |
| 62 return root; | 62 return root; |
| 63 return root.children.reduce((found, child) => found || findNode(child, n
ame, depth - 1), null); | 63 return root.children.reduce((found, child) => found || findNode(child, n
ame, depth - 1), null); |
| 64 } | 64 } |
| 65 | 65 |
| 66 function logNode(node) | 66 function logNode(node) |
| 67 { | 67 { |
| 68 var size = typeof node.selfSize === "number" ? node.selfSize ? ">0" : "=
0" : "-"; | 68 var size = typeof node.selfSize === "number" ? node.selfSize ? ">0" : "=
0" : "-"; |
| 69 InspectorTest.log(`size${size} ${node.functionName}:${node.lineNumber}
:${node.columnNumber}`); | 69 InspectorTest.log(`size${size} ${node.callFrame.functionName}:${node.c
allFrame.lineNumber}:${node.callFrame.columnNumber}`); |
| 70 } | 70 } |
| 71 | 71 |
| 72 //# sourceURL=sampling-heap-profiler.html | 72 //# sourceURL=sampling-heap-profiler.html |
| 73 } | 73 } |
| 74 </script> | 74 </script> |
| 75 </head> | 75 </head> |
| 76 <body onload="runTest()"> | 76 <body onload="runTest()"> |
| 77 <p>Test sampling heap profiler.</p> | 77 <p>Test sampling heap profiler.</p> |
| 78 </body> | 78 </body> |
| 79 </html> | 79 </html> |
| OLD | NEW |