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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 if (window.testRunner) { 5 if (window.testRunner) {
6 testRunner.dumpAsText(); 6 testRunner.dumpAsText();
7 testRunner.waitUntilDone(); 7 testRunner.waitUntilDone();
8 } 8 }
9 9
10 var theMediaQueryList = window.matchMedia("print"); 10 var theMediaQueryList = window.matchMedia("print");
11 11
12 var callCount = 0;
12 theMediaQueryList.addListener(function(aMediaQueryList) { 13 theMediaQueryList.addListener(function(aMediaQueryList) {
14 ++callCount;
15 if (callCount == 1) {
16 // This needs to use setTimeout because we want to test
17 // uncaught exceptions.
18 setTimeout("evaluateInFrontend('disablePage()')", 0);
19 }
20 if (callCount == 2) {
21 // This needs to use setTimeout because we want to test
22 // uncaught exceptions.
23 setTimeout("evaluateInFrontend('finish()')", 0);
24 }
13 objectThatDoesNotExist.produceError(); 25 objectThatDoesNotExist.produceError();
14 }); 26 });
15 27
16 function test() 28 function test()
17 { 29 {
30 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
31 {
32 InspectorTest.sendCommand("Page.disable", {});
33 }
34
35 function finish()
36 {
37 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.
38 }
39
18 function didSetEmulatedMedia(messageObject) 40 function didSetEmulatedMedia(messageObject)
19 { 41 {
20 if (messageObject.error) 42 if (messageObject.error)
21 InspectorTest.log("FAILED: " + messageObject.error.message); 43 InspectorTest.log("FAILED: " + messageObject.error.message);
22 InspectorTest.sendCommand("Page.disable", {});
23 setTimeout("InspectorTest.completeTest();", 20);
24 } 44 }
25 45
46 window.disablePage = disablePage;
47 window.finish = finish;
26 InspectorTest.sendCommand("Page.enable", {}); 48 InspectorTest.sendCommand("Page.enable", {});
27 InspectorTest.sendCommand("Page.setEmulatedMedia", { 49 InspectorTest.sendCommand("Page.setEmulatedMedia", {
28 "media": "print" 50 "media": "print"
29 }, didSetEmulatedMedia); 51 }, didSetEmulatedMedia);
30 } 52 }
31 </script> 53 </script>
32 </head> 54 </head>
33 <body onload="runTest()"> 55 <body onload="runTest()">
34 <p>Test that uncaught exception in MediaQueryListListener will be reported to th e console. On success you should see two exceptions in the listener logged to th e console (first time when the media type is overridden and second - when they a re restored). <a href="https://bugs.webkit.org/show_bug.cgi?id=105162">Bug 10516 2.</p> 56 <p>Test that uncaught exception in MediaQueryListListener will be reported to th e console. On success you should see two exceptions in the listener logged to th e console (first time when the media type is overridden and second - when they a re restored). <a href="https://bugs.webkit.org/show_bug.cgi?id=105162">Bug 10516 2.</p>
35 </body> 57 </body>
36 </html> 58 </html>
OLDNEW
« 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