Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: LayoutTests/fast/events/popup-allowed-from-touch-only-once.html

Issue 329393006: Share a user gesture indicator across touch event sequences (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updates Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/events/popup-allowed-from-touch-only-once-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fd071c553b415587550d9c7aaf4b1b3727da3b6a
--- /dev/null
+++ b/LayoutTests/fast/events/popup-allowed-from-touch-only-once.html
@@ -0,0 +1,84 @@
+<!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()
+ {
+ window.open("about:blank");
+ 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 touchStart(e)
+ {
+ log("touchstart event");
+ e.preventDefault();
+ popup();
+ }
+
+ function touchMove(e)
+ {
+ log("touchmove event");
+ e.preventDefault();
+ popup();
+ }
+
+
+ function touchEnd(e)
+ {
+ log("touchend event");
+ e.preventDefault();
+ popup();
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+
+ document.addEventListener("touchstart", touchStart);
+ document.addEventListener("touchmove", touchMove);
+ document.addEventListener("touchend", touchEnd);
+
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.setCanOpenWindows();
+ testRunner.setPopupBlockingEnabled(true);
+ testRunner.setCloseRemainingWindowsWhenComplete(true);
+ testRunner.waitUntilDone();
+
+ gc();
+ windowCount = testRunner.windowCount();
+
+ if (window.eventSender) {
+ eventSender.clearTouchPoints();
+ eventSender.addTouchPoint(50, 50);
+ eventSender.touchStart();
+ eventSender.addTouchPoint(75, 50);
+ eventSender.touchStart();
+ eventSender.updateTouchPoint(0, 100, 100);
+ eventSender.updateTouchPoint(1, 125, 100);
+ eventSender.touchMove();
+ eventSender.updateTouchPoint(0, 100, 50);
+ eventSender.updateTouchPoint(1, 200, 50);
+ eventSender.touchMove();
+ eventSender.releaseTouchPoint(0);
+ eventSender.releaseTouchPoint(1);
+ eventSender.touchEnd();
+ }
+ }
+ </script>
+ </body>
+ </html>
« no previous file with comments | « no previous file | LayoutTests/fast/events/popup-allowed-from-touch-only-once-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698