Index: LayoutTests/inspector-protocol/page/enable-disable.html |
diff --git a/LayoutTests/inspector-protocol/page/enable-disable.html b/LayoutTests/inspector-protocol/page/enable-disable.html |
index 43b540f5feebee6f84f6f125ba239d036be6f64b..a242cc9c2071c9a45fc5760c4981357d5fbbbeb2 100644 |
--- a/LayoutTests/inspector-protocol/page/enable-disable.html |
+++ b/LayoutTests/inspector-protocol/page/enable-disable.html |
@@ -5,30 +5,56 @@ |
function test() |
{ |
+ var log = []; |
InspectorTest.eventHandler["Timeline.eventRecorded"] = eventRecorded; |
- InspectorTest.sendCommand("Timeline.start", {}); |
- InspectorTest.sendCommand("Page.enable", {}, pageEnabled); |
+ InspectorTest.sendCommand("Timeline.start", {}, enablePage); |
- function pageEnabled() |
+ function enablePage() |
{ |
- InspectorTest.log("Page enabled"); |
- InspectorTest.sendCommand("Page.disable", {}); |
- InspectorTest.sendCommand("Timeline.stop", {}, pageDisabled); |
+ log.push("Timeline started"); |
+ InspectorTest.sendCommand("Page.enable", {}, disablePage); |
} |
- function pageDisabled() |
+ function disablePage() |
{ |
- InspectorTest.log("Page disabled"); |
+ log.push("Page enabled"); |
+ InspectorTest.sendCommand("Page.disable", {}, stopTimeline); |
+ } |
+ |
+ function stopTimeline() |
+ { |
+ log.push("Page disabled"); |
+ InspectorTest.sendCommand("Timeline.stop", {}, dumpRecordedEvents); |
+ } |
+ |
+ function dumpRecordedEvents(next) |
+ { |
+ log.push("Timeline stopped"); |
+ for (var i = 0; i < log.length; ++i) |
+ InspectorTest.log(log[i]); |
InspectorTest.completeTest(); |
} |
function eventRecorded(msg) |
{ |
- var type = msg.params.record.type; |
- if (type.indexOf("GC") !== -1) |
+ var expectedEventTypes = [ |
+ "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
|
+ "RecalculateStyles", |
+ "UpdateLayerTree" |
+ ]; |
+ if (msg.params.record.type === "Program") { |
+ var children = msg.params.record.children; |
+ for (var i = 0; i < children.length; ++i) { |
+ var record = children[i]; |
+ if (record.type.indexOf("GC") !== -1 || expectedEventTypes.indexOf(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.
|
+ continue; |
+ log.push("Timeline.eventRecorded: " + record.type); |
+ } |
return; |
- InspectorTest.log("Timeline.eventRecorded: " + type); |
+ } |
+ InspectorTest.log("FAIL: Unexpected records arrived"); |
+ InspectorTest.logObject(msg); |
} |
} |