| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <body> | |
| 4 <p> | |
| 5 Test that only a single popup is allowed in response to a single | |
| 6 user action. The test passes if only one popup is created. | |
| 7 </p> | |
| 8 <button id="button" onclick="popup()">Click Here</button> | |
| 9 <div id="console"></div> | |
| 10 <script> | |
| 11 function popup() { | |
| 12 window.open("about:blank", "window1"); | |
| 13 window.open("about:blank", "window2"); | |
| 14 if (window.testRunner) { | |
| 15 if (testRunner.windowCount() == windowCount + 1) | |
| 16 document.getElementById("console").innerText = "PASSED"; | |
| 17 else | |
| 18 document.getElementById("console").innerText = "FAILED"; | |
| 19 testRunner.notifyDone(); | |
| 20 } | |
| 21 } | |
| 22 | |
| 23 if (window.testRunner) { | |
| 24 testRunner.dumpAsText(); | |
| 25 testRunner.setCanOpenWindows(); | |
| 26 testRunner.setPopupBlockingEnabled(true); | |
| 27 testRunner.setCloseRemainingWindowsWhenComplete(true); | |
| 28 testRunner.waitUntilDone(); | |
| 29 windowCount = testRunner.windowCount(); | |
| 30 | |
| 31 var button = document.getElementById("button"); | |
| 32 | |
| 33 if (window.eventSender) { | |
| 34 eventSender.mouseMoveTo(button.offsetLeft + button.offsetWid
th / 2, button.offsetTop + button.offsetHeight / 2); | |
| 35 eventSender.mouseDown(); | |
| 36 eventSender.mouseUp(); | |
| 37 } | |
| 38 } | |
| 39 </script> | |
| 40 </body> | |
| 41 </html> | |
| OLD | NEW |