Index: LayoutTests/fast/events/popup-allowed-from-touch-only-once.html |
diff --git a/LayoutTests/fast/events/popup-allowed-from-touch-only-once.html b/LayoutTests/fast/events/popup-allowed-from-touch-only-once.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c0c5959fbbedf789c99445540c36fae28952c9b8 |
--- /dev/null |
+++ b/LayoutTests/fast/events/popup-allowed-from-touch-only-once.html |
@@ -0,0 +1,65 @@ |
+<!DOCTYPE html> |
+<html> |
+ <body> |
+ <p> |
+ Test that only a single popup is allowed in response to a single |
+ touch sequence. The test passes if only one popup is created when |
+ you touch and move around on this page. |
+ </p> |
+ <div id="console"></div> |
+ <script> |
+ function log(msg) |
+ { |
+ document.querySelector("#console").innerHTML += msg + "<br>"; |
+ } |
+ |
+ function popup(e) |
Rick Byers
2014/06/12 20:45:53
If you wanted to be a little more thorough here yo
jochen (gone - plz use gerrit)
2014/06/12 21:09:55
Done.
|
+ { |
+ e.preventDefault(); |
+ window.open("about:blank"); |
+ log("touchmove event"); |
+ if (window.testRunner) { |
+ if (testRunner.windowCount() > windowCount + 1) |
+ log("FAIL: too many popups"); |
+ else if (testRunner.windowCount() == windowCount) |
+ log("FAIL: could not open popup at all"); |
+ } |
+ } |
+ |
+ function touchEnd() |
+ { |
+ log("touchend event"); |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+ } |
+ |
+ document.addEventListener("touchmove", popup); |
+ document.addEventListener("touchend", touchEnd); |
+ |
+ if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ testRunner.setCanOpenWindows(); |
+ testRunner.setPopupBlockingEnabled(true); |
+ testRunner.setCloseRemainingWindowsWhenComplete(true); |
+ testRunner.waitUntilDone(); |
+ |
+ gc(); |
+ windowCount = testRunner.windowCount(); |
+ |
+ var button = document.getElementById("button"); |
Rick Byers
2014/06/12 20:45:53
what's this for? delete it?
jochen (gone - plz use gerrit)
2014/06/12 21:09:55
Done.
|
+ |
+ if (window.eventSender) { |
+ eventSender.clearTouchPoints(); |
+ eventSender.addTouchPoint(50, 50); |
+ eventSender.touchStart(); |
+ eventSender.updateTouchPoint(0, 100, 100); |
+ eventSender.touchMove(); |
+ eventSender.updateTouchPoint(0, 100, 50); |
+ eventSender.touchMove(); |
+ eventSender.releaseTouchPoint(0); |
+ eventSender.touchEnd(); |
+ } |
+ } |
+ </script> |
+ </body> |
+ </html> |