| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
| 4 <script> | 4 <script> |
| 5 var newWindow; | 5 var newWindow; |
| 6 | 6 |
| 7 if (window.testRunner) { | 7 if (window.testRunner) { |
| 8 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
| 9 testRunner.setCanOpenWindows(); | 9 testRunner.setCanOpenWindows(); |
| 10 testRunner.waitUntilDone(); | 10 testRunner.waitUntilDone(); |
| 11 testRunner.setPopupBlockingEnabled(true); | 11 testRunner.setPopupBlockingEnabled(true); |
| 12 } | 12 } |
| 13 | 13 |
| 14 function clickHandler() { | 14 function clickHandler() { |
| 15 setTimeout(function() { | 15 setTimeout(function() { |
| 16 setTimeout(function() { | 16 setTimeout(function() { |
| 17 newWindow = window.open("about:blank"); | 17 newWindow = window.open("about:blank"); |
| 18 self.focus(); | 18 self.focus(); |
| 19 debug("Test calling window.open() in a nested call to setTim
eout(). A popup should not be allowed.") | 19 debug("Test calling window.open() in a nested call to setTim
eout(). A popup should not be allowed.") |
| 20 shouldBeUndefined("newWindow"); | 20 shouldBeNull("newWindow"); |
| 21 if (window.testRunner) | 21 if (window.testRunner) |
| 22 testRunner.notifyDone(); | 22 testRunner.notifyDone(); |
| 23 }, 0); | 23 }, 0); |
| 24 }, 300); | 24 }, 300); |
| 25 } | 25 } |
| 26 | 26 |
| 27 function clickButton() { | 27 function clickButton() { |
| 28 var button = document.getElementById("test"); | 28 var button = document.getElementById("test"); |
| 29 var buttonX = button.offsetLeft + button.offsetWidth / 2; | 29 var buttonX = button.offsetLeft + button.offsetWidth / 2; |
| 30 var buttonY = button.offsetTop + button.offsetHeight / 2; | 30 var buttonY = button.offsetTop + button.offsetHeight / 2; |
| 31 if (window.eventSender) { | 31 if (window.eventSender) { |
| 32 eventSender.mouseMoveTo(buttonX, buttonY); | 32 eventSender.mouseMoveTo(buttonX, buttonY); |
| 33 eventSender.mouseDown(); | 33 eventSender.mouseDown(); |
| 34 eventSender.mouseUp(); | 34 eventSender.mouseUp(); |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 </script> | 37 </script> |
| 38 </head> | 38 </head> |
| 39 <body onload="clickButton()"> | 39 <body onload="clickButton()"> |
| 40 <button id="test" onclick="clickHandler()">Click Here</button> | 40 <button id="test" onclick="clickHandler()">Click Here</button> |
| 41 <div id="console"></div> | 41 <div id="console"></div> |
| 42 </body> | 42 </body> |
| OLD | NEW |