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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 var gesturesOccurred = 0; | 64 var gesturesOccurred = 0; |
65 var scrollAmountX = ['0', '0']; | 65 var scrollAmountX = ['0', '0']; |
66 var scrollAmountY = ['0', '50']; | 66 var scrollAmountY = ['0', '50']; |
67 var wheelEventsOccurred = 0; | 67 var wheelEventsOccurred = 0; |
68 var expectedWheelEventsOccurred = ['0', '0']; | 68 var expectedWheelEventsOccurred = ['0', '0']; |
69 var scrollEventsOccurred = 0; | 69 var scrollEventsOccurred = 0; |
70 var scrolledElement = 'movedbox' | 70 var scrolledElement = 'movedbox' |
71 var scrollEventsOccurred = 0; | 71 var scrollEventsOccurred = 0; |
72 var expectedScrollEventsOccurred = '1'; | 72 var expectedScrollEventsOccurred = '1'; |
73 | 73 |
74 | |
75 function recordScroll(event) { | |
76 debug('scroll event ' + scrollEventsOccurred + '+> ' + event.target); | |
77 scrollEventsOccurred++; | |
78 | |
79 if (window.eventSender) { | |
80 // Because scroll events arrive asynchronously, only one will ar
rive. | |
81 if (gesturesOccurred == expectedGesturesTotal) { | |
82 shouldBe('scrollEventsOccurred', expectedScrollEventsOcc
urred); | |
83 // If we've got here, we've passed. | |
84 successfullyParsed = true; | |
85 isSuccessfullyParsed(); | |
86 if (window.testRunner) | |
87 testRunner.notifyDone(); | |
88 } | |
89 } | |
90 } | |
91 | |
92 | |
93 function firstGestureScroll() | 74 function firstGestureScroll() |
94 { | 75 { |
95 debug("first gesture"); | 76 debug("first gesture"); |
96 eventSender.gestureScrollBegin(10, 72); | 77 eventSender.gestureScrollBegin(10, 72); |
97 eventSender.gestureScrollUpdate(0, -700); | 78 eventSender.gestureScrollUpdate(0, -700); |
98 eventSender.gestureScrollEnd(0, 0); | 79 eventSender.gestureScrollEnd(0, 0); |
99 | 80 |
100 // Wait for layout. | 81 // Wait for layout. |
101 checkScrollOffset(); | 82 checkScrollOffset(); |
102 } | 83 } |
103 | 84 |
104 function secondGestureScroll() | 85 function secondGestureScroll() |
105 { | 86 { |
106 debug("second gesture"); | 87 debug("second gesture"); |
107 eventSender.gestureScrollBegin(12, 40); | 88 eventSender.gestureScrollBegin(12, 40); |
108 eventSender.gestureScrollUpdate(0, -100); | 89 eventSender.gestureScrollUpdate(0, -10); |
| 90 eventSender.gestureScrollUpdate(0, -50); |
109 eventSender.gestureScrollEnd(0, 0); | 91 eventSender.gestureScrollEnd(0, 0); |
110 | 92 |
111 // Wait for layout. | 93 // Wait for layout. |
112 checkScrollOffset(); | 94 checkScrollOffset(); |
113 } | 95 } |
114 | 96 |
115 if (window.testRunner) | 97 if (window.testRunner) |
116 testRunner.waitUntilDone(); | 98 testRunner.waitUntilDone(); |
117 | 99 |
118 function runTest() | 100 function runTest() |
(...skipping 14 matching lines...) Expand all Loading... |
133 } else { | 115 } else { |
134 debug("This test requires DumpRenderTree. Gesture-scroll the page to va
lidate the implementation."); | 116 debug("This test requires DumpRenderTree. Gesture-scroll the page to va
lidate the implementation."); |
135 } | 117 } |
136 } | 118 } |
137 </script> | 119 </script> |
138 | 120 |
139 | 121 |
140 | 122 |
141 </body> | 123 </body> |
142 </html> | 124 </html> |
OLD | NEW |