OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource
s/inspector-protocol-test.js"></script> | |
4 <script> | |
5 | |
6 function test() | |
7 { | |
8 var log = []; | |
9 InspectorTest.eventHandler["Timeline.eventRecorded"] = eventRecorded; | |
10 | |
11 InspectorTest.sendCommand("Timeline.start", {}, timelineStarted); | |
12 | |
13 function timelineStarted() | |
14 { | |
15 log.push("Timeline started"); | |
16 InspectorTest.sendCommand("Page.enable", {}, pageAgentEnabled); | |
17 } | |
18 | |
19 function pageAgentEnabled() | |
20 { | |
21 log.push("Page enabled"); | |
22 InspectorTest.sendCommand("Page.disable", {}, pageAgentDisabled); | |
23 } | |
24 | |
25 function pageAgentDisabled() | |
26 { | |
27 log.push("Page disabled"); | |
28 InspectorTest.sendCommand("NotExistingCommand", {}, didRoundTripOverProt
ocol); | |
29 } | |
30 | |
31 function didRoundTripOverProtocol() | |
32 { | |
33 InspectorTest.sendCommand("Timeline.stop", {}, timelineStopped); | |
34 } | |
35 | |
36 function timelineStopped(next) | |
37 { | |
38 log.push("Timeline stopped"); | |
39 for (var i = 0; i < log.length; ++i) | |
40 InspectorTest.log(log[i]); | |
41 InspectorTest.completeTest(); | |
42 } | |
43 | |
44 function eventRecorded(msg) | |
45 { | |
46 if (msg.params.record.type === "Program") { | |
47 var children = msg.params.record.children; | |
48 for (var i = 0; i < children.length; ++i) { | |
49 var record = children[i]; | |
50 if (record.type === "GCEvent") | |
51 continue; | |
52 log.push("Timeline.eventRecorded: " + record.type); | |
53 } | |
54 return; | |
55 } | |
56 InspectorTest.log("FAIL: Unexpected records arrived"); | |
57 InspectorTest.logObject(msg); | |
58 } | |
59 } | |
60 | |
61 </script> | |
62 <link href="resources/style.css" rel="stylesheet"> | |
63 </head> | |
64 <body onload="runTest()"> | |
65 </body> | |
66 </html> | |
OLD | NEW |