1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../../../resources/js-test.js"></script>
5 <script src=
"resources/gesture-helpers.js"></script>
6 <style type=
"text/css">
40 <body style=
"margin:0" onload=
"runTest();">
41 <div id=
"touchtarget">
42 <table border=
"0" cellspacing=
"0px" id=
"tablefoo">
44 <td><div id=
"redbox"></div></td>
45 <td><div id=
"greenbox"></div></td>
48 <td><div id=
"greenbox"></div></td>
49 <td><div id=
"greenbox"></div></td>
54 <p id=
"description"></p>
55 <div id=
"console"></div>
56 <script type=
"text/javascript">
59 var expectedGesturesTotal
= 2;
60 var gesturesOccurred
= 0;
61 var scrollAmountX
= ['0', '0'];
62 var scrollAmountY
= ['0', '0'];
63 var wheelEventsOccurred
= 0;
64 var expectedWheelEventsOccurred
= ['0', '0'];
65 var scrollEventsOccurred
= 0;
66 var expectedScrollEventsOccurred
= '0';
67 var scrolledElement
= 'movingdiv'
69 function firstGestureScroll()
71 debug("first gesture");
72 eventSender
.gestureScrollBegin(95, 12);
73 eventSender
.gestureScrollUpdate(-90, 0);
74 eventSender
.gestureScrollEnd(0, 0);
80 function secondGestureScroll()
82 debug("second gesture");
83 eventSender
.gestureScrollBegin(12, 97);
84 eventSender
.gestureScrollUpdate(0, -95);
85 eventSender
.gestureScrollEnd(0, 0);
90 // In this test we do not expect any scroll events to
91 // be received by the event listener, so we signal
92 // the end of the test by calling this function instead
93 // of relying on recordScroll() to do it.
97 if (window
.testRunner
)
98 testRunner
.waitUntilDone();
102 movingdiv
= document
.getElementById('touchtarget');
103 movingdiv
.addEventListener("scroll", recordScroll
);
104 window
.addEventListener("mousewheel", recordWheel
);
106 if (window
.eventSender
) {
107 description('This tests that a non-scrollable div cannot be scrolled with touch.');
109 if (checkTestDependencies())
110 firstGestureScroll();
114 debug("This test requires DumpRenderTree. Touch scroll the red rect to log.");
118 function finishTest()
120 if (window
.eventSender
) {
121 if (gesturesOccurred
== expectedGesturesTotal
) {
122 shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred
);
123 successfullyParsed
= true;
124 isSuccessfullyParsed();
125 if (window
.testRunner
)
126 testRunner
.notifyDone();