| 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 test() | 7 function test() |
| 8 { | 8 { |
| 9 InspectorTest.runProfilerTestSuite([ | 9 InspectorTest.runProfilerTestSuite([ |
| 10 function testProfiling(next) | 10 function testProfiling(next) |
| 11 { | 11 { |
| 12 var cpuProfiler = WebInspector.targetManager.mainTarget().cpuProfile
rModel; | 12 var cpuProfiler = SDK.targetManager.mainTarget().cpuProfilerModel; |
| 13 var targetManager = WebInspector.targetManager; | 13 var targetManager = SDK.targetManager; |
| 14 targetManager.addEventListener(WebInspector.TargetManager.Events.Sus
pendStateChanged, onSuspendStateChanged); | 14 targetManager.addEventListener(SDK.TargetManager.Events.SuspendState
Changed, onSuspendStateChanged); |
| 15 var profilesPanel = WebInspector.panels.profiles; | 15 var profilesPanel = UI.panels.profiles; |
| 16 InspectorTest.addSniffer(cpuProfiler, "stopRecording", stopRecording
); | 16 InspectorTest.addSniffer(cpuProfiler, "stopRecording", stopRecording
); |
| 17 InspectorTest.addSniffer(profilesPanel, "_addProfileHeader", onAddPr
ofileHeader); | 17 InspectorTest.addSniffer(profilesPanel, "_addProfileHeader", onAddPr
ofileHeader); |
| 18 profilesPanel.toggleRecord(); // Start profiling. | 18 profilesPanel.toggleRecord(); // Start profiling. |
| 19 | 19 |
| 20 function onAddProfileHeader() | 20 function onAddProfileHeader() |
| 21 { | 21 { |
| 22 profilesPanel.toggleRecord(); // Stop profiling. | 22 profilesPanel.toggleRecord(); // Stop profiling. |
| 23 profilesPanel._reset(); // ... and remove the profile before it
actually stopped. | 23 profilesPanel._reset(); // ... and remove the profile before it
actually stopped. |
| 24 } | 24 } |
| 25 | 25 |
| 26 function onSuspendStateChanged() | 26 function onSuspendStateChanged() |
| 27 { | 27 { |
| 28 if (WebInspector.targetManager.allTargetsSuspended()) { | 28 if (SDK.targetManager.allTargetsSuspended()) { |
| 29 InspectorTest.addResult("Suspending targets"); | 29 InspectorTest.addResult("Suspending targets"); |
| 30 return; | 30 return; |
| 31 } | 31 } |
| 32 InspectorTest.addResult("Resuming targets"); | 32 InspectorTest.addResult("Resuming targets"); |
| 33 InspectorTest.completeProfilerTest(); | 33 InspectorTest.completeProfilerTest(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 function stopRecording(resultPromise) | 36 function stopRecording(resultPromise) |
| 37 { | 37 { |
| 38 InspectorTest.addResult("Stop recording command issued."); | 38 InspectorTest.addResult("Stop recording command issued."); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 50 </script> | 50 </script> |
| 51 </head> | 51 </head> |
| 52 <body onload="runTest()"> | 52 <body onload="runTest()"> |
| 53 <p> | 53 <p> |
| 54 Tests that profile removal right after stop profiling issued works. | 54 Tests that profile removal right after stop profiling issued works. |
| 55 | 55 |
| 56 <a href="http://crbug.com/476430">Bug 476430.</a> | 56 <a href="http://crbug.com/476430">Bug 476430.</a> |
| 57 </p> | 57 </p> |
| 58 </body> | 58 </body> |
| 59 </html> | 59 </html> |
| OLD | NEW |