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 newWindow
= window
.open("about:blank");
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();
35 <body onload=
"clickButton()">
36 <button id=
"test" onclick=
"clickHandler()">Click Here
</button>
37 <div id=
"console"></div>