| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource
s/protocol-test.js"></script> | 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource
s/protocol-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 if (window.testRunner) { | 5 if (window.testRunner) { |
| 6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
| 7 testRunner.waitUntilDone(); | 7 testRunner.waitUntilDone(); |
| 8 } | 8 } |
| 9 | 9 |
| 10 function test() | 10 function test() |
| 11 { | 11 { |
| 12 InspectorTest.sendCommand("Profiler.start", {}, didStartFrontendProfile); | 12 InspectorTest.sendCommand("Profiler.start", {}, didStartFrontendProfile); |
| 13 function didStartFrontendProfile(messageObject) | 13 function didStartFrontendProfile(messageObject) |
| 14 { | 14 { |
| 15 if (!InspectorTest.expectedSuccess("startFrontendProfile", messageObject
)) | 15 if (!InspectorTest.expectedSuccess("startFrontendProfile", messageObject
)) |
| 16 return; | 16 return; |
| 17 InspectorTest.sendCommand("Runtime.evaluate", {expression: "console.prof
ile('org.webkit.profiles.user-initiated.1');"}, didStartConsoleProfile); | 17 InspectorTest.sendCommand("Runtime.evaluate", {expression: "console.prof
ile('Profile 1');"}, didStartConsoleProfile); |
| 18 } | 18 } |
| 19 | 19 |
| 20 function didStartConsoleProfile(messageObject) | 20 function didStartConsoleProfile(messageObject) |
| 21 { | 21 { |
| 22 if (!InspectorTest.expectedSuccess("startConsoleProfile", messageObject)
) | 22 if (!InspectorTest.expectedSuccess("startConsoleProfile", messageObject)
) |
| 23 return; | 23 return; |
| 24 InspectorTest.sendCommand("Runtime.evaluate", {expression: "console.prof
ileEnd('org.webkit.profiles.user-initiated.1');"}, didStopConsoleProfile); | 24 InspectorTest.sendCommand("Runtime.evaluate", {expression: "console.prof
ileEnd('Profile 1');"}, didStopConsoleProfile); |
| 25 } | 25 } |
| 26 | 26 |
| 27 function didStopConsoleProfile(messageObject) | 27 function didStopConsoleProfile(messageObject) |
| 28 { | 28 { |
| 29 if (!InspectorTest.expectedSuccess("stopConsoleProfile", messageObject)) | 29 if (!InspectorTest.expectedSuccess("stopConsoleProfile", messageObject)) |
| 30 return; | 30 return; |
| 31 InspectorTest.sendCommand("Profiler.stop", {}, didStopFrontendProfile); | 31 InspectorTest.sendCommand("Profiler.stop", {}, didStopFrontendProfile); |
| 32 } | 32 } |
| 33 | 33 |
| 34 function didStopFrontendProfile(messageObject) | 34 function didStopFrontendProfile(messageObject) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 </script> | 56 </script> |
| 57 </head> | 57 </head> |
| 58 <body onload="runTest()"> | 58 <body onload="runTest()"> |
| 59 <p> | 59 <p> |
| 60 Test that profiler is able to record a profile. | 60 Test that profiler is able to record a profile. |
| 61 Also it tests that profiler returns an error when it unable to find the profile. | 61 Also it tests that profiler returns an error when it unable to find the profile. |
| 62 </body> | 62 </body> |
| 63 </html> | 63 </html> |
| OLD | NEW |