5 Test that only a single popup is allowed in response to a single
6 touch sequence. The test passes if only one popup is created when
7 you touch and move around on this page.
9 <div id=
"console"></div>
13 document
.querySelector("#console").innerHTML
+= msg
+ "<br>";
18 window
.open("about:blank");
19 if (window
.testRunner
) {
20 if (testRunner
.windowCount() > windowCount
+ 1)
21 log("FAIL: too many popups");
22 else if (testRunner
.windowCount() == windowCount
)
23 log("FAIL: could not open popup at all");
27 function touchStart(e
)
29 log("touchstart event");
36 log("touchmove event");
44 log("touchend event");
47 if (window
.testRunner
)
48 testRunner
.notifyDone();
51 document
.addEventListener("touchstart", touchStart
);
52 document
.addEventListener("touchmove", touchMove
);
53 document
.addEventListener("touchend", touchEnd
);
55 if (window
.testRunner
) {
56 testRunner
.dumpAsText();
57 testRunner
.setCanOpenWindows();
58 testRunner
.setPopupBlockingEnabled(true);
59 testRunner
.setCloseRemainingWindowsWhenComplete(true);
60 testRunner
.waitUntilDone();
63 windowCount
= testRunner
.windowCount();
65 if (window
.eventSender
) {
66 eventSender
.clearTouchPoints();
67 eventSender
.addTouchPoint(50, 50);
68 eventSender
.touchStart();
69 eventSender
.addTouchPoint(75, 50);
70 eventSender
.touchStart();
71 eventSender
.updateTouchPoint(0, 100, 100);
72 eventSender
.updateTouchPoint(1, 125, 100);
73 eventSender
.touchMove();
74 eventSender
.updateTouchPoint(0, 100, 50);
75 eventSender
.updateTouchPoint(1, 200, 50);
76 eventSender
.touchMove();
77 eventSender
.releaseTouchPoint(0);
78 eventSender
.releaseTouchPoint(1);
79 eventSender
.touchEnd();