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 | |
6 function testFunction() | |
7 { | |
8 console.timeStamp("Timestamp"); | |
9 } | |
10 | |
11 function test() | |
12 { | |
13 InspectorTest.eventHandler["Timeline.eventRecorded"] = eventRecorded; | |
14 InspectorTest.eventHandler["Timeline.stopped"] = timelineStopped; | |
15 InspectorTest.log("Recording started"); | |
16 InspectorTest.sendCommand("Timeline.start", { bufferEvents: true }, onStart)
; | |
17 | |
18 function onStart(response) | |
19 { | |
20 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "testFunct
ion()" }, didEvaluate); | |
21 } | |
22 | |
23 function didEvaluate(response) | |
24 { | |
25 InspectorTest.sendCommand("Timeline.stop", {}, onStop); | |
26 } | |
27 | |
28 function eventRecorded(event) | |
29 { | |
30 InspectorTest.log("FAIL: event recorded: " + event.params.record.type); | |
31 } | |
32 | |
33 function timelineStopped(event) | |
34 { | |
35 InspectorTest.log("Timeline.stopped event has arrived."); | |
36 InspectorTest.assert(!event.params.consoleTimeline, "It souldn't be even
t forced by console.timelineEnd"); | |
37 InspectorTest.log("Events:"); | |
38 var events = event.params.events; | |
39 for (var i = 0; i < events.length; ++i) | |
40 dump(events[i], ""); | |
41 } | |
42 | |
43 function onStop(response) | |
44 { | |
45 InspectorTest.log("Recording stopped"); | |
46 InspectorTest.completeTest(); | |
47 } | |
48 | |
49 function dump(event, prefix) | |
50 { | |
51 var eventTypes = { "FunctionCall":true, "TimeStamp":true, "TimerInstall"
:true, "TimerFire":true }; | |
52 if (event.type in eventTypes) | |
53 InspectorTest.log(prefix + event.type); | |
54 for (var i = 0; event.children && i < event.children.length; ++i) | |
55 dump(event.children[i], " " + prefix); | |
56 } | |
57 } | |
58 </script> | |
59 </head> | |
60 <body onLoad="runTest();"> | |
61 </body> | |
62 </html> | |
OLD | NEW |