OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource
s/protocol-test.js"></script> |
| 4 <script> |
| 5 function collectProfiles() |
| 6 { |
| 7 console.profile(); |
| 8 console.profile("titled"); |
| 9 console.profileEnd(); |
| 10 console.profileEnd(); |
| 11 } |
| 12 |
| 13 function test() |
| 14 { |
| 15 InspectorTest.fail = function(message) |
| 16 { |
| 17 InspectorTest.log("FAIL: " + message); |
| 18 InspectorTest.completeTest(); |
| 19 } |
| 20 |
| 21 InspectorTest.sendCommand("Profiler.enable", {}); |
| 22 InspectorTest.sendCommand("Runtime.evaluate", { expression: "collectProfiles
()"}, didCollectProfiles); |
| 23 |
| 24 InspectorTest.eventHandler["Profiler.addProfileHeader"] = function(messageOb
ject) |
| 25 { |
| 26 InspectorTest.log("FAIL: unexpected header = " + JSON.stringify(messageO
bject, null, 4)); |
| 27 } |
| 28 |
| 29 function didCollectProfiles(messageObject) |
| 30 { |
| 31 InspectorTest.sendCommand("Profiler.getProfileHeaders", {}, didReceivePr
ofileHeaders); |
| 32 } |
| 33 |
| 34 function didReceiveProfileHeaders(messageObject) |
| 35 { |
| 36 var headers = messageObject["result"]["headers"]; |
| 37 if (!headers || headers.length !== 2) |
| 38 return InspectorTest.fail("Cannot retrive headers: " + JSON.stringif
y(messageObject, null, 4)); |
| 39 InspectorTest.log("SUCCESS: found 2 profile headers"); |
| 40 for (var i = 0; i < headers.length; i++) { |
| 41 if (headers[i].title === "titled") { |
| 42 InspectorTest.log("SUCCESS: titled profile found"); |
| 43 InspectorTest.sendCommand("Profiler.clearProfiles", {}); |
| 44 InspectorTest.completeTest(); |
| 45 return; |
| 46 } |
| 47 } |
| 48 InspectorTest.fail("Cannot find titled profile"); |
| 49 } |
| 50 } |
| 51 </script> |
| 52 </head> |
| 53 <body onload="runTest()"> |
| 54 <p> |
| 55 Tests that "console.profileEnd()" does not cause crash.<br> |
| 56 <a href="https://bugs.webkit.org/show_bug.cgi?id=105759">Bug 105759.</a><br> |
| 57 </p> |
| 58 </body> |
| 59 </html> |
OLD | NEW |