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

Side by Side Diff: LayoutTests/fast/events/touch/gesture/gesture-tap-result.html

Issue 267313008: First-cut at fixing unhandled Tap event returns in Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Simplified the layout test's termination logic. 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
« no previous file with comments | « no previous file | LayoutTests/fast/events/touch/gesture/gesture-tap-result-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 PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../../resources/js-test.js"></script>
5 </head>
6 <body onload="runTest();">
7
8 <input id="input" type="text" value="editable text"><br>
9 <span id="plain">This is plain text with no handler</span><br>
10 <span id="consumes">This text consumes events using preventDefault()</span><br>< br>
11 Clicking or tapping on the "consumes" section should have no effect on the selec tion,
12 but clicking in the plain section should clear it.
13
14 <p id="description"></p>
15 <div id="console"></div>
16
17 <script>
18 var plainResult = null;
19 var consumesResult = null;
20
21 function plainCallback() {
22 }
23
24 function consumeCallback(event) {
25 event.preventDefault();
26 }
27
28 function runTest() {
29 document.getElementById('input').select();
30 var consumes = document.getElementById('consumes');
31 consumes.addEventListener("mousedown", consumeCallback, false);
Rick Byers 2014/06/03 21:27:25 Now that you're not logging even info, I suggest y
donnd 2014/06/03 21:40:25 Done.
32 consumes.addEventListener("click", consumeCallback, false);
33 consumes.addEventListener("dblclick", consumeCallback, false);
34 consumes.addEventListener("mouseup", consumeCallback, false);
35 consumes.addEventListener("mousemove", consumeCallback, false);
36 var plain = document.getElementById('plain');
37 plain.addEventListener("mousedown", plainCallback, false);
38 plain.addEventListener("click", plainCallback, false);
39 plain.addEventListener("dblclick", plainCallback, false);
40 plain.addEventListener("mouseup", plainCallback, false);
41 plain.addEventListener("mousemove", plainCallback, false);
42
43 if (window.testRunner) {
44 testRunner.dumpAsText();
45 }
46
47 if (window.eventSender) {
48 description("This tests Tap events being consumed by a handler.");
49
50 // A 'tap' gesture event should generate a sequence of mouse events,
51 // which do not affect the selection when consumed.
52 var consumesRect = document.getElementById('consumes').getBoundingClient Rect();
53 consumesResult = eventSender.gestureTap(consumesRect.left, consumesRect. top);
54 shouldBe('consumesResult', 'true');
55 shouldNotBe('window.getSelection().toString()', '');
56
57 // Tapping on plain text does not consume the event, and clears the sele ction.
58 var plainRect = document.getElementById('plain').getBoundingClientRect() ;
59 plainResult = eventSender.gestureTap(plainRect.left, plainRect.top);
60 shouldBe('plainResult', 'false');
61 shouldBeEmptyString('window.getSelection().toString()');
62 } else {
63 debug("This test requires DumpRenderTree. Tap on the text to log.")
64 }
65 }
66 </script>
67 </body>
68 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/touch/gesture/gesture-tap-result-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698