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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/console-profile.html

Issue 2150803002: [DevTools] Add callFrame to CPUProfileNode & SamplingHeapProfileNode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/heap-profiler/sampling-heap-profiler.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 function collectProfiles() 5 function collectProfiles()
6 { 6 {
7 console.profile("outer"); 7 console.profile("outer");
8 console.profile(42); 8 console.profile(42);
9 console.profileEnd("outer"); 9 console.profileEnd("outer");
10 console.profileEnd(42); 10 console.profileEnd(42);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 InspectorTest.log("SUCCESS: retrieved '42' profile"); 48 InspectorTest.log("SUCCESS: retrieved '42' profile");
49 var root = profile.head; 49 var root = profile.head;
50 if (!findFunctionInProfile(root, "collectProfiles")) 50 if (!findFunctionInProfile(root, "collectProfiles"))
51 return InspectorTest.fail("collectProfiles function not found in the profile: " + JSON.stringify(profile, null, 4)); 51 return InspectorTest.fail("collectProfiles function not found in the profile: " + JSON.stringify(profile, null, 4));
52 InspectorTest.log("SUCCESS: found 'collectProfiles' function in the prof ile"); 52 InspectorTest.log("SUCCESS: found 'collectProfiles' function in the prof ile");
53 InspectorTest.completeTest(); 53 InspectorTest.completeTest();
54 } 54 }
55 55
56 function findFunctionInProfile(node, functionName) 56 function findFunctionInProfile(node, functionName)
57 { 57 {
58 if (node.functionName === functionName) 58 if (node.callFrame.functionName === functionName)
59 return true; 59 return true;
60 var children = node.children; 60 var children = node.children;
61 for (var i = 0; i < children.length; ++i) 61 for (var i = 0; i < children.length; ++i)
62 if (findFunctionInProfile(children[i], functionName)) 62 if (findFunctionInProfile(children[i], functionName))
63 return true; 63 return true;
64 return false; 64 return false;
65 } 65 }
66 } 66 }
67 </script> 67 </script>
68 </head> 68 </head>
69 <body onload="runTest()"> 69 <body onload="runTest()">
70 <p> 70 <p>
71 Tests that console.profile/profileEnd will record CPU profile when inspector fro nt-end is connected.<br> 71 Tests that console.profile/profileEnd will record CPU profile when inspector fro nt-end is connected.<br>
72 </p> 72 </p>
73 </body> 73 </body>
74 </html> 74 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/heap-profiler/sampling-heap-profiler.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698