OLD | NEW |
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('InspectorTest.sendPageDisable()')", 0); |
| 19 } |
| 20 if (callCount == 2) { |
| 21 // This needs to use setTimeout because we want to test |
| 22 // uncaught exceptions. |
| 23 setTimeout("evaluateInFrontend('InspectorTest.completeTest()')", 0); |
| 24 } |
13 objectThatDoesNotExist.produceError(); | 25 objectThatDoesNotExist.produceError(); |
14 }); | 26 }); |
15 | 27 |
16 function test() | 28 function test() |
17 { | 29 { |
| 30 InspectorTest.sendPageDisable = function() |
| 31 { |
| 32 InspectorTest.sendCommand("Page.disable", {}); |
| 33 } |
| 34 |
18 function didSetEmulatedMedia(messageObject) | 35 function didSetEmulatedMedia(messageObject) |
19 { | 36 { |
20 if (messageObject.error) | 37 if (messageObject.error) |
21 InspectorTest.log("FAILED: " + messageObject.error.message); | 38 InspectorTest.log("FAILED: " + messageObject.error.message); |
22 InspectorTest.sendCommand("Page.disable", {}); | |
23 setTimeout("InspectorTest.completeTest();", 20); | |
24 } | 39 } |
25 | 40 |
26 InspectorTest.sendCommand("Page.enable", {}); | 41 InspectorTest.sendCommand("Page.enable", {}); |
27 InspectorTest.sendCommand("Page.setEmulatedMedia", { | 42 InspectorTest.sendCommand("Page.setEmulatedMedia", { |
28 "media": "print" | 43 "media": "print" |
29 }, didSetEmulatedMedia); | 44 }, didSetEmulatedMedia); |
30 } | 45 } |
31 </script> | 46 </script> |
32 </head> | 47 </head> |
33 <body onload="runTest()"> | 48 <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> | 49 <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> | 50 </body> |
36 </html> | 51 </html> |
OLD | NEW |