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 0 ms delay. A popup should be allowed.")
19 shouldBeNonNull("newWindow");
20 if (window
.testRunner
)
21 testRunner
.notifyDone();
25 function clickButton() {
26 var button
= document
.getElementById("test");
27 var buttonX
= button
.offsetLeft
+ button
.offsetWidth
/ 2;
28 var buttonY
= button
.offsetTop
+ button
.offsetHeight
/ 2;
29 if (window
.eventSender
) {
30 eventSender
.mouseMoveTo(buttonX
, buttonY
);
31 eventSender
.mouseDown();
32 eventSender
.mouseUp();
37 <body onload=
"clickButton()">
38 <button id=
"test" onclick=
"clickHandler()">Click Here
</button>
39 <div id=
"console"></div>