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

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: 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
17 {
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");
24 }
25 }
26
27 function touchStart(e)
28 {
29 log("touchstart event");
30 e.preventDefault();
31 popup();
32 }
33
34 function touchMove(e)
35 {
36 log("touchmove event");
37 e.preventDefault();
38 popup();
39 }
40
41
42 function touchEnd(e)
43 {
44 log("touchend event");
45 e.preventDefault();
46 popup();
47 if (window.testRunner)
48 testRunner.notifyDone();
49 }
50
51 document.addEventListener("touchstart", touchStart);
52 document.addEventListener("touchmove", touchMove);
53 document.addEventListener("touchend", touchEnd);
54
55 if (window.testRunner) {
56 testRunner.dumpAsText();
57 testRunner.setCanOpenWindows();
58 testRunner.setPopupBlockingEnabled(true);
59 testRunner.setCloseRemainingWindowsWhenComplete(true);
60 testRunner.waitUntilDone();
61
62 gc();
63 windowCount = testRunner.windowCount();
64
65 if (window.eventSender) {
66 eventSender.clearTouchPoints();
67 eventSender.addTouchPoint(50, 50);
68 eventSender.addTouchPoint(75, 50);
Rick Byers 2014/06/12 21:14:23 nit: please add one more touchStart above here - t
jochen (gone - plz use gerrit) 2014/06/12 21:17:06 Done.
69 eventSender.touchStart();
70 eventSender.updateTouchPoint(0, 100, 100);
71 eventSender.updateTouchPoint(1, 125, 100);
72 eventSender.touchMove();
73 eventSender.updateTouchPoint(0, 100, 50);
74 eventSender.updateTouchPoint(1, 200, 50);
75 eventSender.touchMove();
76 eventSender.releaseTouchPoint(0);
77 eventSender.releaseTouchPoint(1);
78 eventSender.touchEnd();
79 }
80 }
81 </script>
82 </body>
83 </html>
OLDNEW
« 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