5 Test that only a single popup is allowed in response to a single
6 user action. The test passes if only one popup is created.
8 <button id=
"button" onclick=
"popup()">Click Here
</button>
9 <div id=
"console"></div>
12 window
.open("about:blank", "window1");
13 window
.open("about:blank", "window2");
14 if (window
.testRunner
) {
15 if (testRunner
.windowCount() == windowCount
+ 1)
16 document
.getElementById("console").innerText
= "PASSED";
18 document
.getElementById("console").innerText
= "FAILED";
19 testRunner
.notifyDone();
23 if (window
.testRunner
) {
24 testRunner
.dumpAsText();
25 testRunner
.setCanOpenWindows();
26 testRunner
.setPopupBlockingEnabled(true);
27 testRunner
.setCloseRemainingWindowsWhenComplete(true);
28 testRunner
.waitUntilDone();
31 windowCount
= testRunner
.windowCount();
33 var button
= document
.getElementById("button");
35 if (window
.eventSender
) {
36 eventSender
.mouseMoveTo(button
.offsetLeft
+ button
.offsetWidth
/ 2, button
.offsetTop
+ button
.offsetHeight
/ 2);
37 eventSender
.mouseDown();
38 eventSender
.mouseUp();