Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1039)

Unified Diff: LayoutTests/inspector-protocol/page/enable-disable.html

Issue 340803002: DevTools: fix for test inspector-protocol/page/enable-disable.html (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comments addressed Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..4568d1ef2ac907c77b725b58b118b984df61adb0 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", {}, timelineStarted);
- function pageEnabled()
+ function timelineStarted()
{
- InspectorTest.log("Page enabled");
- InspectorTest.sendCommand("Page.disable", {});
- InspectorTest.sendCommand("Timeline.stop", {}, pageDisabled);
+ log.push("Timeline started");
+ InspectorTest.sendCommand("Page.enable", {}, pageAgentEnabled);
}
- function pageDisabled()
+ function pageAgentEnabled()
{
- InspectorTest.log("Page disabled");
+ log.push("Page enabled");
+ InspectorTest.sendCommand("Page.disable", {}, pageAgentDisabled);
+ }
+
+ function pageAgentDisabled()
+ {
+ log.push("Page disabled");
+ InspectorTest.sendCommand("NotExistingCommand", {}, didRoundTripOverProtocol);
+ }
+
+ function didRoundTripOverProtocol()
+ {
+ InspectorTest.sendCommand("Timeline.stop", {}, timelineStopped);
+ }
+
+ function timelineStopped(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)
+ 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 === "GCEvent")
+ continue;
+ log.push("Timeline.eventRecorded: " + record.type);
+ }
return;
- InspectorTest.log("Timeline.eventRecorded: " + type);
+ }
+ InspectorTest.log("FAIL: Unexpected records arrived");
+ InspectorTest.logObject(msg);
}
}

Powered by Google App Engine
This is Rietveld 408576698