Web Inspector: Page: re-add enable/disable after r248454
[WebKit-https.git] / LayoutTests / inspector / page / media-query-list-listener-exception.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../http/tests/inspector/resources/protocol-test.js"></script>
5 <script>
6 let theMediaQueryList = window.matchMedia("print");
7 theMediaQueryList.addListener(function(aMediaQueryList) {
8     objectThatDoesNotExist.produceError();
9 });
10
11 function test()
12 {
13     InspectorProtocol.sendCommand("Page.enable", {});
14     InspectorProtocol.sendCommand("Page.setEmulatedMedia", {"media": "print"}, function(messageObject) {
15         if (messageObject.error)
16             ProtocolTest.log("FAILED: " + messageObject.error.message);
17         InspectorProtocol.sendCommand("Page.disable", {});
18         ProtocolTest.completeTest();
19     });
20 }
21 </script>
22 </head>
23 <body onload="runTest()">
24 <p>Test that uncaught exception in MediaQueryListListener will be reported to the console. On success you should see two exceptions in the listener logged to the console (first time when the media type is overridden and second - when they are restored). <a href="https://bugs.webkit.org/show_bug.cgi?id=105162">Bug 105162.</p>
25 </body>
26 </html>