OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-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 var headers = []; | |
25 InspectorTest.eventHandler["Profiler.consoleProfileFinished"] = function(mes
sageObject) | |
26 { | |
27 headers.push({ | |
28 title: messageObject["params"]["title"] | |
29 }); | |
30 } | |
31 | |
32 function didCollectProfiles(messageObject) | |
33 { | |
34 if (headers.length !== 2) | |
35 return InspectorTest.fail("Cannot retrive headers: " + JSON.stringif
y(messageObject, null, 4)); | |
36 InspectorTest.log("SUCCESS: found 2 profile headers"); | |
37 for (var i = 0; i < headers.length; i++) { | |
38 if (headers[i].title === "titled") { | |
39 InspectorTest.log("SUCCESS: titled profile found"); | |
40 InspectorTest.completeTest(); | |
41 return; | |
42 } | |
43 } | |
44 InspectorTest.fail("Cannot find titled profile"); | |
45 } | |
46 } | |
47 </script> | |
48 </head> | |
49 <body onload="runTest()"> | |
50 <p> | |
51 Tests that "console.profileEnd()" does not cause crash.<br> | |
52 <a href="https://bugs.webkit.org/show_bug.cgi?id=105759">Bug 105759.</a><br> | |
53 </p> | |
54 </body> | |
55 </html> | |
OLD | NEW |