Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / popup-blocking-timers4.html
bloba4a4332b0be9bf5e153789ee7472a113a18468cf
1 <!DOCTYPE html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 <script>
5 var newWindow;
7 if (window.testRunner) {
8 testRunner.dumpAsText();
9 testRunner.setCanOpenWindows();
10 testRunner.waitUntilDone();
11 testRunner.setPopupBlockingEnabled(true);
14 function clickHandler() {
15 setTimeout(function() {
16 setTimeout(function() {
17 newWindow = window.open("about:blank");
18 self.focus();
19 debug("Test calling window.open() in a nested call to setTimeout(). A popup should not be allowed.")
20 shouldBeUndefined("newWindow");
21 if (window.testRunner)
22 testRunner.notifyDone();
23 }, 0);
24 }, 300);
27 function clickButton() {
28 var button = document.getElementById("test");
29 var buttonX = button.offsetLeft + button.offsetWidth / 2;
30 var buttonY = button.offsetTop + button.offsetHeight / 2;
31 if (window.eventSender) {
32 eventSender.mouseMoveTo(buttonX, buttonY);
33 eventSender.mouseDown();
34 eventSender.mouseUp();
37 </script>
38 </head>
39 <body onload="clickButton()">
40 <button id="test" onclick="clickHandler()">Click Here</button>
41 <div id="console"></div>
42 </body>