Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / popup-blocking-timers1.html
blob83086f05fd933586b564eb22130211f3844ec96b
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 newWindow = window.open("about:blank");
16 self.focus();
17 debug("Test calling window.open() directly. A popup should be allowed.");
18 shouldBeNonNull("newWindow");
19 if (window.testRunner)
20 testRunner.notifyDone();
23 function clickButton() {
24 var button = document.getElementById("test");
25 var buttonX = button.offsetLeft + button.offsetWidth / 2;
26 var buttonY = button.offsetTop + button.offsetHeight / 2;
27 if (window.eventSender) {
28 eventSender.mouseMoveTo(buttonX, buttonY);
29 eventSender.mouseDown();
30 eventSender.mouseUp();
33 </script>
34 </head>
35 <body onload="clickButton()">
36 <button id="test" onclick="clickHandler()">Click Here</button>
37 <div id="console"></div>
38 </body>