Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> | 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 | 5 |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 var log = []; | |
| 8 InspectorTest.eventHandler["Timeline.eventRecorded"] = eventRecorded; | 9 InspectorTest.eventHandler["Timeline.eventRecorded"] = eventRecorded; |
| 9 | 10 |
| 10 InspectorTest.sendCommand("Timeline.start", {}); | 11 InspectorTest.sendCommand("Timeline.start", {}, enablePage); |
| 11 InspectorTest.sendCommand("Page.enable", {}, pageEnabled); | |
| 12 | 12 |
| 13 function pageEnabled() | 13 function enablePage() |
| 14 { | 14 { |
| 15 InspectorTest.log("Page enabled"); | 15 log.push("Timeline started"); |
| 16 InspectorTest.sendCommand("Page.disable", {}); | 16 InspectorTest.sendCommand("Page.enable", {}, disablePage); |
| 17 InspectorTest.sendCommand("Timeline.stop", {}, pageDisabled); | |
| 18 } | 17 } |
| 19 | 18 |
| 20 function pageDisabled() | 19 function disablePage() |
| 21 { | 20 { |
| 22 InspectorTest.log("Page disabled"); | 21 log.push("Page enabled"); |
| 22 InspectorTest.sendCommand("Page.disable", {}, stopTimeline); | |
| 23 } | |
| 24 | |
| 25 function stopTimeline() | |
| 26 { | |
| 27 log.push("Page disabled"); | |
| 28 InspectorTest.sendCommand("Timeline.stop", {}, dumpRecordedEvents); | |
| 29 } | |
| 30 | |
| 31 function dumpRecordedEvents(next) | |
| 32 { | |
| 33 log.push("Timeline stopped"); | |
| 34 for (var i = 0; i < log.length; ++i) | |
| 35 InspectorTest.log(log[i]); | |
| 23 InspectorTest.completeTest(); | 36 InspectorTest.completeTest(); |
| 24 } | 37 } |
| 25 | 38 |
| 26 function eventRecorded(msg) | 39 function eventRecorded(msg) |
| 27 { | 40 { |
| 28 var type = msg.params.record.type; | 41 var expectedEventTypes = [ |
| 29 if (type.indexOf("GC") !== -1) | 42 "ScheduleStyleRecalculation", |
|
yurys
2014/06/18 14:06:12
This event will be followed by Layout event I supp
loislo
2014/06/18 14:22:00
I saw RecalculateStyles and UpdateLayerTree
| |
| 43 "RecalculateStyles", | |
| 44 "UpdateLayerTree" | |
| 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.indexOf("GC") !== -1 || expectedEventTypes.index Of(record.type) !== -1) | |
|
yurys
2014/06/18 14:06:12
GC event should be in the expected array.
loislo
2014/06/18 14:22:00
Done.
| |
| 51 continue; | |
| 52 log.push("Timeline.eventRecorded: " + record.type); | |
| 53 } | |
| 30 return; | 54 return; |
| 31 InspectorTest.log("Timeline.eventRecorded: " + type); | 55 } |
| 56 InspectorTest.log("FAIL: Unexpected records arrived"); | |
| 57 InspectorTest.logObject(msg); | |
| 32 } | 58 } |
| 33 } | 59 } |
| 34 | 60 |
| 35 </script> | 61 </script> |
| 36 </head> | 62 </head> |
| 37 <body onload="runTest()"> | 63 <body onload="runTest()"> |
| 38 </body> | 64 </body> |
| 39 </html> | 65 </html> |
| OLD | NEW |