Chromium Code Reviews| 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" |