| <script src="../../resources/js-test-pre.js"></script> |
| var firstIntervalExecution = true; |
| testRunner.setCanOpenWindows(); |
| testRunner.waitUntilDone(); |
| testRunner.setPopupBlockingEnabled(true); |
| function clickHandler() { |
| intervalId = setInterval(function() { |
| debug("Test calling window.open() in a 100 ms interval. A popup should only be allowed on the first execution of the interval."); |
| newWindow = window.open("about:blank"); |
| if (firstIntervalExecution) { |
| shouldBeNonNull("newWindow"); |
| firstIntervalExecution = false; |
| shouldBeNull("newWindow"); |
| clearInterval(intervalId); |
| var button = document.getElementById("test"); |
| var buttonX = button.offsetLeft + button.offsetWidth / 2; |
| var buttonY = button.offsetTop + button.offsetHeight / 2; |
| if (window.eventSender) { |
| eventSender.mouseMoveTo(buttonX, buttonY); |
| <body onload="clickButton()"> |
| <button id="test" onclick="clickHandler()">Click Here</button> |