OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <link rel="stylesheet" href="../../../js/resources/js-test-style.css"> | 4 <link rel="stylesheet" href="../../../js/resources/js-test-style.css"> |
5 <script src="../../../js/resources/js-test-pre.js"></script> | 5 <script src="../../../js/resources/js-test-pre.js"></script> |
6 <script src="resources/gesture-helpers.js"></script> | 6 <script src="resources/gesture-helpers.js"></script> |
7 <style type="text/css"> | 7 <style type="text/css"> |
8 ::-webkit-scrollbar { | 8 ::-webkit-scrollbar { |
9 width: 0px; | 9 width: 0px; |
10 height: 0px; | 10 height: 0px; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 var gesturesOccurred = 0; | 79 var gesturesOccurred = 0; |
80 var scrollAmountX = ['0', '0']; | 80 var scrollAmountX = ['0', '0']; |
81 var scrollAmountY = ['0', '160']; | 81 var scrollAmountY = ['0', '160']; |
82 var wheelEventsOccurred = 0; | 82 var wheelEventsOccurred = 0; |
83 var expectedWheelEventsOccurred = ['0', '0']; | 83 var expectedWheelEventsOccurred = ['0', '0']; |
84 var scrollEventsOccurred = 0; | 84 var scrollEventsOccurred = 0; |
85 var scrolledElement = 'document.body' | 85 var scrolledElement = 'document.body' |
86 var scrollEventsOccurred = 0; | 86 var scrollEventsOccurred = 0; |
87 var expectedScrollEventsOccurred = '1'; | 87 var expectedScrollEventsOccurred = '1'; |
88 | 88 |
89 function recordScroll(event) { | |
90 debug('scroll event ' + scrollEventsOccurred + '+> ' + event.target); | |
91 scrollEventsOccurred++; | |
92 | |
93 if (window.eventSender) { | |
94 // Because scroll events arrive asynchronously, only one will ar
rive. | |
95 if (gesturesOccurred == expectedGesturesTotal) { | |
96 shouldBe('scrollEventsOccurred', expectedScrollEventsOcc
urred); | |
97 // If we've got here, we've passed. | |
98 successfullyParsed = true; | |
99 isSuccessfullyParsed(); | |
100 if (window.testRunner) | |
101 testRunner.notifyDone(); | |
102 } | |
103 } | |
104 } | |
105 | |
106 // Always construct a page larger than the vertical height of the window. | 89 // Always construct a page larger than the vertical height of the window. |
107 function buildPage() | 90 function buildPage() |
108 { | 91 { |
109 var table = document.getElementById('table_to_fill'); | 92 var table = document.getElementById('table_to_fill'); |
110 var targetHeight = document.body.offsetHeight; | 93 var targetHeight = document.body.offsetHeight; |
111 var cellPairHeight = table.offsetHeight; | 94 var cellPairHeight = table.offsetHeight; |
112 var numberOfReps = targetHeight / cellPairHeight * 2; | 95 var numberOfReps = targetHeight / cellPairHeight * 2; |
113 var i; | 96 var i; |
114 for (i = 0; i < numberOfReps; i++) { | 97 for (i = 0; i < numberOfReps; i++) { |
115 var p = document.createElement('tr'); | 98 var p = document.createElement('tr'); |
(...skipping 13 matching lines...) Expand all Loading... |
129 eventSender.gestureScrollEnd(0, 0); | 112 eventSender.gestureScrollEnd(0, 0); |
130 | 113 |
131 // Wait for layout. | 114 // Wait for layout. |
132 checkScrollOffset(); | 115 checkScrollOffset(); |
133 } | 116 } |
134 | 117 |
135 function secondGestureScroll() | 118 function secondGestureScroll() |
136 { | 119 { |
137 debug("second gesture"); | 120 debug("second gesture"); |
138 eventSender.gestureScrollBegin(12, 40); | 121 eventSender.gestureScrollBegin(12, 40); |
139 eventSender.gestureScrollUpdate(0, -250); | 122 eventSender.gestureScrollUpdate(0, -200); |
| 123 eventSender.gestureScrollUpdate(0, -160); |
140 eventSender.gestureScrollEnd(0, 0); | 124 eventSender.gestureScrollEnd(0, 0); |
141 | 125 |
142 // Wait for layout. | 126 // Wait for layout. |
143 checkScrollOffset(); | 127 checkScrollOffset(); |
144 } | 128 } |
145 | 129 |
146 if (window.testRunner) | 130 if (window.testRunner) |
147 testRunner.waitUntilDone(); | 131 testRunner.waitUntilDone(); |
148 | 132 |
149 function runTest() | 133 function runTest() |
(...skipping 13 matching lines...) Expand all Loading... |
163 } else { | 147 } else { |
164 debug("This test requires DumpRenderTree. Gesture-scroll the page to va
lidate the implementation."); | 148 debug("This test requires DumpRenderTree. Gesture-scroll the page to va
lidate the implementation."); |
165 } | 149 } |
166 } | 150 } |
167 </script> | 151 </script> |
168 | 152 |
169 | 153 |
170 | 154 |
171 </body> | 155 </body> |
172 </html> | 156 </html> |
OLD | NEW |