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">
22 <iframe id=
"touchtarget" src=
"resources/scroll-inside-iframe.html" scrolling=
"no"></iframe>
23 <p id=
"description"></p>
24 <div id=
"console"></div>
25 <script type=
"text/javascript">
28 var expectedGesturesTotal
= 2;
29 var gesturesOccurred
= 0;
30 var scrollAmountX
= ['0', '0'];
31 var scrollAmountY
= ['0', '0'];
32 var wheelEventsOccurred
= 0;
33 var expectedWheelEventsOccurred
= ['0', '0'];
34 var scrollEventsOccurred
= 0;
35 var expectedScrollEventsOccurred
= '0';
36 var scrolledElement
= 'touchtarget.contentDocument.scrollingElement'
38 function firstGestureScroll()
40 debug("first gesture");
41 eventSender
.gestureScrollBegin(12, 150);
42 eventSender
.gestureScrollUpdate(0, -140);
43 eventSender
.gestureScrollEnd(0, 0);
49 function secondGestureScroll()
51 debug("second gesture");
52 eventSender
.gestureScrollBegin(12, 110);
53 eventSender
.gestureScrollUpdate(0, -60);
54 eventSender
.gestureScrollEnd(0, 0);
59 // In this test we do not expect any scroll events to
60 // be received by the event listener, so we signal
61 // the end of the test by calling this function instead
62 // of relying on recordScroll() to do it.
66 if (window
.testRunner
)
67 testRunner
.waitUntilDone();
71 touchtarget
= document
.getElementById('touchtarget');
72 touchtarget
.contentDocument
.addEventListener("scroll", recordScroll
);
73 touchtarget
.contentDocument
.body
.addEventListener("mousewheel", recordWheel
);
75 if (window
.eventSender
) {
76 description('This tests that non-scrollable iframes cannot be scrolled with touch.');
77 if (checkTestDependencies())
82 debug("This test requires DumpRenderTree . Touch-scroll the red/green strip.");
88 if (window
.eventSender
) {
89 if (gesturesOccurred
== expectedGesturesTotal
) {
90 shouldBe('scrollEventsOccurred', expectedScrollEventsOccurred
);
91 successfullyParsed
= true;
92 isSuccessfullyParsed();
93 if (window
.testRunner
)
94 testRunner
.notifyDone();