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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-scrollbar.html

Issue 2925883003: [Touch Adjustment] Pass primary_pointer_type to WebGestureEvent and disable adjustment for stylus (Closed)
Patch Set: jochen and dtapuska's comments: Add default value Created 3 years, 5 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
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../../resources/js-test.js"></script> 4 <script src="../../../../resources/js-test.js"></script>
5 <style type="text/css"> 5 <style type="text/css">
6 ::-webkit-scrollbar { 6 ::-webkit-scrollbar {
7 background-color: #ccc; 7 background-color: #ccc;
8 height: 15px; 8 height: 15px;
9 width: 15px; 9 width: 15px;
10 } 10 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 var scrollThumbSafeOffset = 80; 52 var scrollThumbSafeOffset = 80;
53 var scrollbarY = movingDiv.offsetTop + scrollThumbSafeOffset; 53 var scrollbarY = movingDiv.offsetTop + scrollThumbSafeOffset;
54 54
55 // Ensure we use a touch with an area to test under touch adjustment 55 // Ensure we use a touch with an area to test under touch adjustment
56 var touchWidth = 25; 56 var touchWidth = 25;
57 var touchHeight = 25; 57 var touchHeight = 25;
58 58
59 shouldBe('movingDiv.scrollTop', '0'); 59 shouldBe('movingDiv.scrollTop', '0');
60 eventSender.gestureTapDown(scrollbarX, scrollbarY, touchWidth, touchHeight); 60 eventSender.gestureTapDown(scrollbarX, scrollbarY, touchWidth, touchHeight);
61 eventSender.gestureShowPress(scrollbarX, scrollbarY, touchWidth, touchHeight ); 61 eventSender.gestureShowPress(scrollbarX, scrollbarY, touchWidth, touchHeight );
62 eventSender.gestureScrollBegin(scrollbarX + 20, scrollbarY, touchWidth, touc hHeight); 62 eventSender.gestureScrollBegin(scrollbarX + 20, scrollbarY);
63 eventSender.gestureTapCancel(scrollbarX, scrollbarY); 63 eventSender.gestureTapCancel(scrollbarX, scrollbarY);
64 shouldBe('movingDiv.scrollTop', '0'); 64 shouldBe('movingDiv.scrollTop', '0');
65 eventSender.gestureScrollUpdate(0, 20); 65 eventSender.gestureScrollUpdate(0, 20);
66 shouldBeGreaterThanOrEqual('movingDiv.scrollTop', '20'); 66 shouldBeGreaterThanOrEqual('movingDiv.scrollTop', '20');
67 eventSender.gestureScrollUpdate(0, 60); 67 eventSender.gestureScrollUpdate(0, 60);
68 shouldBeGreaterThanOrEqual('movingDiv.scrollTop', '85'); 68 shouldBeGreaterThanOrEqual('movingDiv.scrollTop', '85');
69 eventSender.gestureScrollEnd(0, 0); 69 eventSender.gestureScrollEnd(0, 0);
70 shouldBeGreaterThanOrEqual('movingDiv.scrollTop', '85'); 70 shouldBeGreaterThanOrEqual('movingDiv.scrollTop', '85');
71 71
72 // Test horizontal scrollbar too 72 // Test horizontal scrollbar too
73 scrollbarY = movingDiv.offsetTop + movingDiv.offsetHeight - 5; 73 scrollbarY = movingDiv.offsetTop + movingDiv.offsetHeight - 5;
74 scrollbarX = movingDiv.offsetLeft + scrollThumbSafeOffset; 74 scrollbarX = movingDiv.offsetLeft + scrollThumbSafeOffset;
75 shouldBe('movingDiv.scrollLeft', '0'); 75 shouldBe('movingDiv.scrollLeft', '0');
76 eventSender.gestureTapDown(scrollbarX, scrollbarY, touchWidth, touchHeight); 76 eventSender.gestureTapDown(scrollbarX, scrollbarY, touchWidth, touchHeight);
77 eventSender.gestureShowPress(scrollbarX, scrollbarY, touchWidth, touchHeight ); 77 eventSender.gestureShowPress(scrollbarX, scrollbarY, touchWidth, touchHeight );
78 eventSender.gestureScrollBegin(scrollbarX, scrollbarY + 20, touchWidth, touc hHeight); 78 eventSender.gestureScrollBegin(scrollbarX, scrollbarY + 20);
79 eventSender.gestureTapCancel(scrollbarX, scrollbarY); 79 eventSender.gestureTapCancel(scrollbarX, scrollbarY);
80 shouldBe('movingDiv.scrollLeft', '0'); 80 shouldBe('movingDiv.scrollLeft', '0');
81 eventSender.gestureScrollUpdate(20, 0); 81 eventSender.gestureScrollUpdate(20, 0);
82 shouldBeGreaterThanOrEqual('movingDiv.scrollLeft', '20'); 82 shouldBeGreaterThanOrEqual('movingDiv.scrollLeft', '20');
83 eventSender.gestureScrollUpdate(60, 0); 83 eventSender.gestureScrollUpdate(60, 0);
84 shouldBeGreaterThanOrEqual('movingDiv.scrollLeft', '85'); 84 shouldBeGreaterThanOrEqual('movingDiv.scrollLeft', '85');
85 eventSender.gestureScrollEnd(0, 0); 85 eventSender.gestureScrollEnd(0, 0);
86 shouldBeGreaterThanOrEqual('movingDiv.scrollLeft', '85'); 86 shouldBeGreaterThanOrEqual('movingDiv.scrollLeft', '85');
87 87
88 // If we've got here, we've passed. 88 // If we've got here, we've passed.
(...skipping 22 matching lines...) Expand all
111 scrollTest(); 111 scrollTest();
112 else 112 else
113 exitIfNecessary(); 113 exitIfNecessary();
114 } else { 114 } else {
115 debug("This test requires DumpRenderTree."); 115 debug("This test requires DumpRenderTree.");
116 } 116 }
117 } 117 }
118 </script> 118 </script>
119 </body> 119 </body>
120 </html> 120 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698