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

Unified Diff: LayoutTests/inspector-protocol/css/media-query-listener-exception.html

Issue 398413002: Make media-query-listener-exception.html unflaky. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: try #2 Created 6 years, 5 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/css/media-query-listener-exception.html
diff --git a/LayoutTests/inspector-protocol/css/media-query-listener-exception.html b/LayoutTests/inspector-protocol/css/media-query-listener-exception.html
index 9595581d02c845eb6fcface18794db85cabdbec4..b04aeb9dd7f356a7c0fdb14a6e27e3e874a59439 100644
--- a/LayoutTests/inspector-protocol/css/media-query-listener-exception.html
+++ b/LayoutTests/inspector-protocol/css/media-query-listener-exception.html
@@ -9,20 +9,42 @@ if (window.testRunner) {
var theMediaQueryList = window.matchMedia("print");
+var callCount = 0;
theMediaQueryList.addListener(function(aMediaQueryList) {
+ ++callCount;
+ if (callCount == 1) {
+ // This needs to use setTimeout because we want to test
+ // uncaught exceptions.
+ setTimeout("evaluateInFrontend('disablePage()')", 0);
+ }
+ if (callCount == 2) {
+ // This needs to use setTimeout because we want to test
+ // uncaught exceptions.
+ setTimeout("evaluateInFrontend('finish()')", 0);
+ }
objectThatDoesNotExist.produceError();
});
function test()
{
+ function disablePage()
yurys 2014/07/18 08:50:02 We use InspectorTest instead of adding test-specif
cbiesinger 2014/07/18 22:28:32 Ah, thank you! I made the change. (Is there a web
+ {
+ InspectorTest.sendCommand("Page.disable", {});
+ }
+
+ function finish()
+ {
+ InspectorTest.completeTest();
yurys 2014/07/18 08:50:02 Same here. In this case you can call "evaluateInFr
cbiesinger 2014/07/18 22:28:32 Done.
+ }
+
function didSetEmulatedMedia(messageObject)
{
if (messageObject.error)
InspectorTest.log("FAILED: " + messageObject.error.message);
- InspectorTest.sendCommand("Page.disable", {});
- setTimeout("InspectorTest.completeTest();", 20);
}
+ window.disablePage = disablePage;
+ window.finish = finish;
InspectorTest.sendCommand("Page.enable", {});
InspectorTest.sendCommand("Page.setEmulatedMedia", {
"media": "print"
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/inspector-protocol/css/media-query-listener-exception-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698