};
};
+/**
+ * Waits for current throttler invocations, if any.
+ * @param {!WebInspector.Throttler} throttler
+ * @param {!function} callback
+ */
+TestSuite.prototype.waitForThrottler = function(throttler, callback)
+{
+ var test = this;
+ var scheduleShouldFail = true;
+ test.addSniffer(throttler, "schedule", onSchedule);
+
+ function hasSomethingScheduled()
+ {
+ return throttler._isRunningProcess || throttler._process;
+ }
+
+ function checkState()
+ {
+ if (!hasSomethingScheduled()) {
+ scheduleShouldFail = false;
+ callback();
+ return;
+ }
+
+ test.addSniffer(throttler, "_processCompletedForTests", checkState);
+ }
+
+ function onSchedule()
+ {
+ if (scheduleShouldFail)
+ test.fail("Unexpected Throttler.schedule");
+ }
+
+ checkState();
+};
// UI Tests
test.releaseControl();
}
- step1();
+ WebInspector.overridesSupport._deviceMetricsChangedListenerMuted = true;
test.takeControl();
+ this.waitForThrottler(WebInspector.overridesSupport._deviceMetricsThrottler, step1);
};
TestSuite.prototype.waitForTestResultsInConsole = function()
new TestSuite().runTest(name);
}
-WebInspector.notifications.addEventListener(WebInspector.NotificationService.Events.InspectorUILoadedForTests, runTests);
+WebInspector.notifications.addEventListener(WebInspector.NotificationService.Events.InspectorAgentEnabledForTests, runTests);
})();