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

Side by Side Diff: LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-listbox.html

Issue 347773002: Implement select listbox using shadow DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
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 <script src="resources/gesture-helpers.js"></script> 5 <script src="resources/gesture-helpers.js"></script>
6 6
7 </head> 7 </head>
8 8
9 <body style="margin:0" onload="runTest()"> 9 <body style="margin:0" onload="runTest()">
10 <div id="container" style="height: 500px; overflow-x: scroll; overflow-y: scroll"> 10 <div id="container" style="height: 500px; overflow-x: scroll; overflow-y: scroll">
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 shouldBe('box.scrollTop', '0'); 51 shouldBe('box.scrollTop', '0');
52 shouldBe('container.scrollTop', '0'); 52 shouldBe('container.scrollTop', '0');
53 53
54 eventSender.gestureScrollBegin(gestureX, gestureY); 54 eventSender.gestureScrollBegin(gestureX, gestureY);
55 eventSender.gestureScrollUpdateWithoutPropagation(0, -itemHeight); 55 eventSender.gestureScrollUpdateWithoutPropagation(0, -itemHeight);
56 eventSender.gestureScrollUpdateWithoutPropagation(0, -itemHeight); 56 eventSender.gestureScrollUpdateWithoutPropagation(0, -itemHeight);
57 eventSender.gestureScrollUpdateWithoutPropagation(0, -10); 57 eventSender.gestureScrollUpdateWithoutPropagation(0, -10);
58 eventSender.gestureScrollEnd(0, 0); 58 eventSender.gestureScrollEnd(0, 0);
59 59
60 debug("Flinging the list box should scroll the list, the scrolls sho uld be locked to item boundaries"); 60 debug("Flinging the list box should scroll the list, the scrolls sho uld be locked to item boundaries");
61 shouldBe('box.scrollTop', '2*itemHeight'); 61 shouldBe('box.scrollTop', '2*itemHeight+10');
62 shouldBe('container.scrollTop', '0'); 62 shouldBe('container.scrollTop', '0');
63 63
64 resetScroll(); 64 resetScroll();
65 65
66 eventSender.gestureScrollBegin(gestureX, gestureY); 66 eventSender.gestureScrollBegin(gestureX, gestureY);
67 eventSender.gestureScrollUpdateWithoutPropagation(0, -fullyScrolled) ; 67 eventSender.gestureScrollUpdateWithoutPropagation(0, -fullyScrolled) ;
68 eventSender.gestureScrollUpdateWithoutPropagation(0, -300); 68 eventSender.gestureScrollUpdateWithoutPropagation(0, -300);
69 eventSender.gestureScrollUpdateWithoutPropagation(0, -100); 69 eventSender.gestureScrollUpdateWithoutPropagation(0, -100);
70 eventSender.gestureScrollUpdateWithoutPropagation(0, -100); 70 eventSender.gestureScrollUpdateWithoutPropagation(0, -100);
71 eventSender.gestureScrollEnd(0, 0); 71 eventSender.gestureScrollEnd(0, 0);
(...skipping 24 matching lines...) Expand all
96 eventSender.gestureScrollUpdate(0, -(itemHeight-3)); 96 eventSender.gestureScrollUpdate(0, -(itemHeight-3));
97 eventSender.gestureScrollUpdate(0, -3); 97 eventSender.gestureScrollUpdate(0, -3);
98 eventSender.gestureScrollUpdate(0, -(itemHeight-3)); 98 eventSender.gestureScrollUpdate(0, -(itemHeight-3));
99 eventSender.gestureScrollUpdate(0, -3); 99 eventSender.gestureScrollUpdate(0, -3);
100 eventSender.gestureScrollUpdate(0, -(itemHeight-3)); 100 eventSender.gestureScrollUpdate(0, -(itemHeight-3));
101 eventSender.gestureScrollUpdate(0, -3); 101 eventSender.gestureScrollUpdate(0, -3);
102 eventSender.gestureScrollUpdate(0, -6); 102 eventSender.gestureScrollUpdate(0, -6);
103 eventSender.gestureScrollEnd(0, 0); 103 eventSender.gestureScrollEnd(0, 0);
104 104
105 debug("Gesture scrolling list should scroll the list, the scrolls sh ould lock to item boundaries"); 105 debug("Gesture scrolling list should scroll the list, the scrolls sh ould lock to item boundaries");
106 shouldBe('box.scrollTop', '3*itemHeight'); 106 shouldBe('box.scrollTop', '3*itemHeight+6');
107 shouldBe('container.scrollTop', '0'); 107 shouldBe('container.scrollTop', '0');
108 108
109 resetScroll(); 109 resetScroll();
110 shouldBe('box.scrollTop', '0'); 110 shouldBe('box.scrollTop', '0');
111 shouldBe('container.scrollTop', '0'); 111 shouldBe('container.scrollTop', '0');
112 112
113 eventSender.gestureScrollBegin(gestureX, gestureY); 113 eventSender.gestureScrollBegin(gestureX, gestureY);
114 eventSender.gestureScrollUpdate(0, -fullyScrolled); 114 eventSender.gestureScrollUpdate(0, -fullyScrolled);
115 eventSender.gestureScrollUpdate(0, -50); 115 eventSender.gestureScrollUpdate(0, -50);
116 eventSender.gestureScrollEnd(0, 0); 116 eventSender.gestureScrollEnd(0, 0);
(...skipping 21 matching lines...) Expand all
138 shouldBe('container.scrollLeft', '60'); 138 shouldBe('container.scrollLeft', '60');
139 } 139 }
140 140
141 if (window.testRunner) 141 if (window.testRunner)
142 testRunner.waitUntilDone(); 142 testRunner.waitUntilDone();
143 143
144 function runTest() 144 function runTest()
145 { 145 {
146 box = document.getElementById("box"); 146 box = document.getElementById("box");
147 container = document.getElementById("container"); 147 container = document.getElementById("container");
148 itemHeight = (box.clientHeight + 1) / box.size; 148 itemHeight = box.clientHeight / box.size;
149 149
150 fullyScrolled = box.scrollHeight - box.clientHeight; 150 fullyScrolled = box.scrollHeight - box.clientHeight;
151 151
152 if (window.eventSender) { 152 if (window.eventSender) {
153 description('This tests that an input text field can be properly scrolled with touch gestures'); 153 description('This tests that an input text field can be properly scrolled with touch gestures');
154 154
155 if (checkTestDependencies() && window.eventSender.gestureScrollU pdateWithoutPropagation) { 155 if (checkTestDependencies() && window.eventSender.gestureScrollU pdateWithoutPropagation) {
156 testFlingGestures(); 156 testFlingGestures();
157 testGestureScroll(); 157 testGestureScroll();
158 testHorizontalScroll(); 158 testHorizontalScroll();
159 testRunner.notifyDone(); 159 testRunner.notifyDone();
160 } else 160 } else
161 exitIfNecessary(); 161 exitIfNecessary();
162 } else { 162 } else {
163 debug("This test requires DumpRenderTree. Gesture-scroll the pa ge to validate the implementation."); 163 debug("This test requires DumpRenderTree. Gesture-scroll the pa ge to validate the implementation.");
164 } 164 }
165 } 165 }
166 </script> 166 </script>
167 </body> 167 </body>
168 </html> 168 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698