| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="profiler-test.js"></script> | 4 <script src="profiler-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 function pageFunction() { | 7 function pageFunction() { |
| 8 console.profile("p1"); | 8 console.profile("p1"); |
| 9 console.profileEnd("p1"); | 9 console.profileEnd("p1"); |
| 10 console.profile("p1"); | 10 console.profile("p1"); |
| 11 console.profileEnd("p1"); | 11 console.profileEnd("p1"); |
| 12 console.profile("p2"); | 12 console.profile("p2"); |
| 13 console.profileEnd("p2"); | 13 console.profileEnd("p2"); |
| 14 } | 14 } |
| 15 | 15 |
| 16 function test() | 16 function test() |
| 17 { | 17 { |
| 18 InspectorTest.startProfilerTest(function() { | 18 InspectorTest.startProfilerTest(function() { |
| 19 function viewLoaded(view) { | 19 function viewLoaded(view) { |
| 20 var profiles = WebInspector.panels.profiles; | 20 var profiles = WebInspector.panels.profiles; |
| 21 var type = profiles.getProfileType("CPU"); | 21 var type = WebInspector.ProfileTypeRegistry.instance.cpuProfileType; |
| 22 while (type.getProfiles().length !== 0) | 22 while (type.getProfiles().length !== 0) |
| 23 type.removeProfile(type.getProfiles()[0]); | 23 type.removeProfile(type.getProfiles()[0]); |
| 24 InspectorTest.addResult("Profile groups after removal:"); | 24 InspectorTest.addResult("Profile groups after removal:"); |
| 25 for (var key in profiles._profileGroups) | 25 for (var key in profiles._profileGroups) |
| 26 InspectorTest.addResult(key + ": " + profiles._profileGroups[key
].length); | 26 InspectorTest.addResult(key + ": " + profiles._profileGroups[key
].length); |
| 27 InspectorTest.assertEquals(0, type.treeElement.children.length, "All
children has been removed"); | 27 InspectorTest.assertEquals(0, type.treeElement.children.length, "All
children has been removed"); |
| 28 InspectorTest.completeProfilerTest(); | 28 InspectorTest.completeProfilerTest(); |
| 29 } | 29 } |
| 30 WebInspector.showPanel("profiles"); | 30 WebInspector.showPanel("profiles"); |
| 31 InspectorTest.evaluateInConsole("pageFunction()", function() {}); | 31 InspectorTest.evaluateInConsole("pageFunction()", function() {}); |
| 32 InspectorTest.showProfileWhenAdded("p2"); | 32 InspectorTest.showProfileWhenAdded("p2"); |
| 33 InspectorTest.waitUntilProfileViewIsShown("p2", viewLoaded); | 33 InspectorTest.waitUntilProfileViewIsShown("p2", viewLoaded); |
| 34 }); | 34 }); |
| 35 } | 35 } |
| 36 | 36 |
| 37 </script> | 37 </script> |
| 38 </head> | 38 </head> |
| 39 <body onload="runTest()"> | 39 <body onload="runTest()"> |
| 40 <p> | 40 <p> |
| 41 Tests that CPU profile removal from a group works. | 41 Tests that CPU profile removal from a group works. |
| 42 | 42 |
| 43 <a href="https://bugs.webkit.org/show_bug.cgi?id=110466">Bug 110466</a> | 43 <a href="https://bugs.webkit.org/show_bug.cgi?id=110466">Bug 110466</a> |
| 44 </p> | 44 </p> |
| 45 </body> | 45 </body> |
| 46 </html> | 46 </html> |
| OLD | NEW |