1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../../../resources/js-test.js"></script>
5 <style type=
"text/css">
22 word-wrap: break-word
;
49 <body style=
"margin:0" onload=
"runTest();">
50 <div id=
"gesturetarget">
52 <table border=
"0" cellspacing=
"0px">
54 <td><div id=
"redbox"></div></td>
55 <td><div id=
"greenbox"></div></td>
58 <td><div id=
"greenbox"></div></td>
59 <td><div id=
"greenbox"></div></td>
65 <p id=
"description"></p>
66 <div id=
"console"></div>
67 <script type=
"text/javascript">
70 var expectedScrollsTotal
= 2;
71 var scrollsOccurred
= 0;
72 var scrollAmountX
= ['90', '90'];
73 var scrollAmountY
= ['0', '95'];
75 function checkScrollOffset()
77 movingdiv
= document
.getElementById('movingbox');
78 if (window
.eventSender
) {
79 shouldBe('movingdiv.scrollTop', scrollAmountY
[scrollsOccurred
]);
80 shouldBe('movingdiv.scrollLeft', scrollAmountX
[scrollsOccurred
]);
84 if (scrollsOccurred
== expectedScrollsTotal
) {
85 // If we've got here, we've passed.
86 isSuccessfullyParsed();
87 if (window
.testRunner
)
88 testRunner
.notifyDone();
90 secondGestureScrollSequence();
94 function firstGestureScrollSequence()
96 debug("first gesture");
98 eventSender
.gestureScrollBegin(95, 12);
99 eventSender
.gestureScrollUpdate(-90, 0);
100 eventSender
.gestureScrollEnd(0, 0);
106 function secondGestureScrollSequence()
108 debug("second gesture");
110 eventSender
.gestureScrollBegin(12, 97);
111 eventSender
.gestureScrollUpdate(0, -95);
112 eventSender
.gestureScrollEnd(0, 0);
118 function exitIfNecessary()
120 debug('Gesture events not implemented on this platform or broken');
121 isSuccessfullyParsed();
122 if (window
.testRunner
)
123 testRunner
.notifyDone();
126 if (window
.testRunner
)
127 testRunner
.waitUntilDone();
131 var movingdiv
= document
.getElementById('movingbox');
133 if (window
.eventSender
) {
134 description('This tests scroll gesture events. ' +
135 'Square is (mostly) green on pass');
137 if (eventSender
.clearTouchPoints
)
138 firstGestureScrollSequence();
142 debug("This test requires DumpRenderTree.");