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

Side by Side Diff: LayoutTests/fast/events/touch/touch-event-cancelable.html

Issue 273503004: Add console warning for canceling uncancelable TouchEvent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tweak style Created 6 years, 7 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/touch/touch-event-cancelable-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
1 <script src="../../../resources/js-test.js"></script> 1 <script src="../../../resources/js-test.js"></script>
2 2
3 <p id="description"></p> 3 <p id="description"></p>
4 <div id="console"></div> 4 <div id="console"></div>
5 <script type="text/javascript"> 5 <script type="text/javascript">
6 description('Test that touch events may or may not be marked cancelable. http:// crbug.com/365681'); 6 description('Test that touch events may or may not be marked cancelable. http:// crbug.com/365681');
7 7
8 var gotTouchMove = false; 8 var gotTouchMove = false;
9 var touchEvent; 9 var touchEvent;
10 10
11 document.addEventListener('touchmove', function(event) { 11 document.addEventListener('touchmove', function(event) {
12 shouldBeFalse('gotTouchMove'); 12 shouldBeFalse('gotTouchMove');
13 gotTouchMove = true; 13 gotTouchMove = true;
14 touchEvent = event; 14 touchEvent = event;
15 shouldBeFalse('touchEvent.defaultPrevented'); 15 shouldBeFalse('touchEvent.defaultPrevented');
16 console.log('Calling preventDefault on TouchEvent with cancelable=' + event. cancelable);
16 touchEvent.preventDefault(); 17 touchEvent.preventDefault();
17 }, false); 18 }, false);
18 19
19 if (window.eventSender) { 20 if (window.eventSender) {
20 eventSender.addTouchPoint(152, 152); 21 eventSender.addTouchPoint(152, 152);
21 eventSender.touchStart(); 22 eventSender.touchStart();
22 23
23 eventSender.updateTouchPoint(0, 155, 155); 24 eventSender.updateTouchPoint(0, 155, 155);
24 eventSender.setTouchCancelable(true); 25 eventSender.setTouchCancelable(true);
25 debug('Sending cancelable touchmove'); 26 debug('Sending cancelable touchmove');
26 eventSender.touchMove(); 27 eventSender.touchMove();
27 shouldBeTrue('gotTouchMove'); 28 shouldBeTrue('gotTouchMove');
28 shouldBeTrue('touchEvent.cancelable'); 29 shouldBeTrue('touchEvent.cancelable');
29 shouldBeTrue('touchEvent.defaultPrevented'); 30 shouldBeTrue('touchEvent.defaultPrevented');
30 gotTouchMove = false; 31 gotTouchMove = false;
31 32
32 debug(''); 33 debug('');
33 debug('Sending uncancelable touchmove'); 34 debug('Sending uncancelable touchmove');
34 eventSender.setTouchCancelable(false); 35 eventSender.setTouchCancelable(false);
35 eventSender.updateTouchPoint(0, 160, 160); 36 eventSender.updateTouchPoint(0, 160, 160);
36 eventSender.touchMove(); 37 eventSender.touchMove();
37 shouldBeTrue('gotTouchMove'); 38 shouldBeTrue('gotTouchMove');
38 shouldBeFalse('touchEvent.cancelable'); 39 shouldBeFalse('touchEvent.cancelable');
39 shouldBeFalse('touchEvent.defaultPrevented'); 40 shouldBeFalse('touchEvent.defaultPrevented');
40 } else { 41 } else {
41 debug('This test requires --dump-render-tree.'); 42 debug('This test requires --dump-render-tree.');
42 } 43 }
43 44
44 </script> 45 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/touch/touch-event-cancelable-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698