5 Test that only a single popup is allowed in response to a single
6 user action, even if the the user action triggers multiple events.
7 The test passes if only one popup is created.
9 <button id=
"button" onmousedown=
"popup1()" onmouseup=
"popup2()">Click Here
</button>
10 <div id=
"console"></div>
13 window
.open("about:blank", "window1");
17 window
.open("about:blank", "window2");
18 if (window
.testRunner
) {
19 if (testRunner
.windowCount() == windowCount
+ 1)
20 document
.getElementById("console").innerText
= "PASSED";
22 document
.getElementById("console").innerText
= "FAILED";
23 testRunner
.notifyDone();
27 if (window
.testRunner
) {
28 testRunner
.dumpAsText();
29 testRunner
.setCanOpenWindows();
30 testRunner
.setPopupBlockingEnabled(true);
31 testRunner
.setCloseRemainingWindowsWhenComplete(true);
32 testRunner
.waitUntilDone();
33 windowCount
= testRunner
.windowCount();
35 var button
= document
.getElementById("button");
37 if (window
.eventSender
) {
38 eventSender
.mouseMoveTo(button
.offsetLeft
+ button
.offsetWidth
/ 2, button
.offsetTop
+ button
.offsetHeight
/ 2);
39 eventSender
.mouseDown();
40 eventSender
.mouseUp();