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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p>
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.
8 </p>
9 <div id="console"></div>
10 <script>
11 function log(msg)
12 {
13 document.querySelector("#console").innerHTML += msg + "<br>";
14 }
15
16 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.
17 {
18 e.preventDefault();
19 window.open("about:blank");
20 log("touchmove event");
21 if (window.testRunner) {
22 if (testRunner.windowCount() > windowCount + 1)
23 log("FAIL: too many popups");
24 else if (testRunner.windowCount() == windowCount)
25 log("FAIL: could not open popup at all");
26 }
27 }
28
29 function touchEnd()
30 {
31 log("touchend event");
32 if (window.testRunner)
33 testRunner.notifyDone();
34 }
35
36 document.addEventListener("touchmove", popup);
37 document.addEventListener("touchend", touchEnd);
38
39 if (window.testRunner) {
40 testRunner.dumpAsText();
41 testRunner.setCanOpenWindows();
42 testRunner.setPopupBlockingEnabled(true);
43 testRunner.setCloseRemainingWindowsWhenComplete(true);
44 testRunner.waitUntilDone();
45
46 gc();
47 windowCount = testRunner.windowCount();
48
49 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.
50
51 if (window.eventSender) {
52 eventSender.clearTouchPoints();
53 eventSender.addTouchPoint(50, 50);
54 eventSender.touchStart();
55 eventSender.updateTouchPoint(0, 100, 100);
56 eventSender.touchMove();
57 eventSender.updateTouchPoint(0, 100, 50);
58 eventSender.touchMove();
59 eventSender.releaseTouchPoint(0);
60 eventSender.touchEnd();
61 }
62 }
63 </script>
64 </body>
65 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698