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 | 8 |
9 ::-webkit-scrollbar { | 9 ::-webkit-scrollbar { |
10 width: 0px; | 10 width: 0px; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 var gesturesOccurred = 0; | 85 var gesturesOccurred = 0; |
86 var scrollAmountX = ['0', '0']; | 86 var scrollAmountX = ['0', '0']; |
87 var scrollAmountY = ['0', '10']; | 87 var scrollAmountY = ['0', '10']; |
88 var wheelEventsOccurred = 0; | 88 var wheelEventsOccurred = 0; |
89 var expectedWheelEventsOccurred = ['0', '0']; | 89 var expectedWheelEventsOccurred = ['0', '0']; |
90 var scrollEventsOccurred = 0; | 90 var scrollEventsOccurred = 0; |
91 var scrolledElement = 'movedbox' | 91 var scrolledElement = 'movedbox' |
92 var scrollEventsOccurred = 0; | 92 var scrollEventsOccurred = 0; |
93 var expectedScrollEventsOccurred = '1'; | 93 var expectedScrollEventsOccurred = '1'; |
94 | 94 |
95 | |
96 function recordScroll(event) { | |
97 debug('scroll event ' + scrollEventsOccurred + '+> ' + event.target); | |
98 scrollEventsOccurred++; | |
99 | |
100 if (window.eventSender) { | |
101 // Because scroll events arrive asynchronously, only one will ar
rive. | |
102 if (gesturesOccurred == expectedGesturesTotal) { | |
103 shouldBe('scrollEventsOccurred', expectedScrollEventsOcc
urred); | |
104 // If we've got here, we've passed. | |
105 successfullyParsed = true; | |
106 isSuccessfullyParsed(); | |
107 if (window.testRunner) | |
108 testRunner.notifyDone(); | |
109 } | |
110 } | |
111 } | |
112 | |
113 | |
114 function firstGestureScroll() | 95 function firstGestureScroll() |
115 { | 96 { |
116 debug("first gesture"); | 97 debug("first gesture"); |
117 eventSender.gestureScrollBegin(10, 72); | 98 eventSender.gestureScrollBegin(10, 72); |
118 eventSender.gestureScrollUpdate(0, -150); | 99 eventSender.gestureScrollUpdate(0, -150); |
119 eventSender.gestureScrollEnd(0, 0); | 100 eventSender.gestureScrollEnd(0, 0); |
120 | 101 |
121 // Wait for layout. | 102 // Wait for layout. |
122 checkScrollOffset(); | 103 checkScrollOffset(); |
123 } | 104 } |
124 | 105 |
125 function secondGestureScroll() | 106 function secondGestureScroll() |
126 { | 107 { |
127 debug("second gesture"); | 108 debug("second gesture"); |
128 eventSender.gestureScrollBegin(12, 40); | 109 eventSender.gestureScrollBegin(12, 40); |
129 eventSender.gestureScrollUpdate(0, -60); | 110 eventSender.gestureScrollUpdate(0, -50); |
| 111 eventSender.gestureScrollUpdate(0, -10); |
130 eventSender.gestureScrollEnd(0, 0); | 112 eventSender.gestureScrollEnd(0, 0); |
131 | 113 |
132 // Wait for layout. | 114 // Wait for layout. |
133 checkScrollOffset(); | 115 checkScrollOffset(); |
134 } | 116 } |
135 | 117 |
136 if (window.testRunner) | 118 if (window.testRunner) |
137 testRunner.waitUntilDone(); | 119 testRunner.waitUntilDone(); |
138 | 120 |
139 function runTest() | 121 function runTest() |
(...skipping 14 matching lines...) Expand all Loading... |
154 } else { | 136 } else { |
155 debug("This test requires DumpRenderTree. Gesture-scroll the page to va
lidate the implementation."); | 137 debug("This test requires DumpRenderTree. Gesture-scroll the page to va
lidate the implementation."); |
156 } | 138 } |
157 } | 139 } |
158 </script> | 140 </script> |
159 | 141 |
160 | 142 |
161 | 143 |
162 </body> | 144 </body> |
163 </html> | 145 </html> |
OLD | NEW |