3 <script src=
"../../resources/js-test.js"></script>
7 if (window
.testRunner
) {
8 testRunner
.dumpAsText();
9 testRunner
.setCanOpenWindows();
10 testRunner
.waitUntilDone();
11 testRunner
.setPopupBlockingEnabled(true);
14 function clickHandler() {
15 setTimeout(function() {
16 newWindow
= window
.open("about:blank");
18 debug("Test calling window.open() with a 1001 ms delay. A popup should not be allowed.")
19 shouldBeUndefined("newWindow");
21 if (window
.testRunner
)
22 testRunner
.notifyDone();
24 if (window
.eventSender
)
25 eventSender
.leapForward(1001);
28 function clickButton() {
29 var button
= document
.getElementById("test");
30 var buttonX
= button
.offsetLeft
+ button
.offsetWidth
/ 2;
31 var buttonY
= button
.offsetTop
+ button
.offsetHeight
/ 2;
32 if (window
.eventSender
) {
33 eventSender
.mouseMoveTo(buttonX
, buttonY
);
34 eventSender
.mouseDown();
35 eventSender
.mouseUp();
40 <body onload=
"clickButton()">
41 <button id=
"test" onclick=
"clickHandler()">Click Here
</button>
42 <div id=
"console"></div>