| 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, even if the the user action triggers multiple events. | |
| 7 The test passes if only one popup is created. | |
| 8 </p> | |
| 9 <button id="button" onmousedown="popup1()" onmouseup="popup2()">Click He
re</button> | |
| 10 <div id="console"></div> | |
| 11 <script> | |
| 12 function popup1() { | |
| 13 window.open("about:blank", "window1"); | |
| 14 } | |
| 15 | |
| 16 function popup2() { | |
| 17 window.open("about:blank", "window2"); | |
| 18 if (window.testRunner) { | |
| 19 if (testRunner.windowCount() == windowCount + 1) | |
| 20 document.getElementById("console").innerText = "PASSED"; | |
| 21 else | |
| 22 document.getElementById("console").innerText = "FAILED"; | |
| 23 testRunner.notifyDone(); | |
| 24 } | |
| 25 } | |
| 26 | |
| 27 if (window.testRunner) { | |
| 28 testRunner.dumpAsText(); | |
| 29 testRunner.setCanOpenWindows(); | |
| 30 testRunner.setPopupBlockingEnabled(true); | |
| 31 testRunner.setCloseRemainingWindowsWhenComplete(true); | |
| 32 testRunner.waitUntilDone(); | |
| 33 windowCount = testRunner.windowCount(); | |
| 34 | |
| 35 var button = document.getElementById("button"); | |
| 36 | |
| 37 if (window.eventSender) { | |
| 38 eventSender.mouseMoveTo(button.offsetLeft + button.offsetWid
th / 2, button.offsetTop + button.offsetHeight / 2); | |
| 39 eventSender.mouseDown(); | |
| 40 eventSender.mouseUp(); | |
| 41 } | |
| 42 } | |
| 43 </script> | |
| 44 </body> | |
| 45 </html> | |
| OLD | NEW |