| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../../../../resources/js-test-pre.js"></script> |
| <script src="resources/gesture-helpers.js"></script> |
| <style type="text/css"> |
| #touchtarget { |
| width: 200px; |
| height: 200px; |
| position: relative; |
| background: white; |
| } |
| |
| ::-webkit-scrollbar { |
| width: 0px; |
| height: 0px; |
| } |
| |
| </style> |
| </head> |
| <body> |
| <iframe id="touchtarget" src="resources/scroll-inside-iframe.html"></iframe> |
| <p id="description"></p> |
| <div id="console"></div> |
| <script type="text/javascript"> |
| |
| var touchtarget; |
| var expectedGesturesTotal = 2; |
| var gesturesOccurred = 0; |
| var scrollAmountX = ['0', '0']; |
| var scrollAmountY = ['140', '200']; |
| var wheelEventsOccurred = 0; |
| var expectedWheelEventsOccurred = ['0', '0']; |
| var scrollEventsOccurred = 0; |
| var expectedScrollEventsOccurred = '1'; |
| var scrolledElement = 'touchtarget.contentDocument.body' |
| |
| function firstGestureScroll() |
| { |
| debug("first gesture"); |
| eventSender.gestureScrollBegin(12, 150); |
| eventSender.gestureScrollUpdate(0, -140); |
| eventSender.gestureScrollEnd(0, 0); |
| |
| // Wait for layout. |
| checkScrollOffset(); |
| } |
| |
| function secondGestureScroll() |
| { |
| debug("second gesture"); |
| eventSender.gestureScrollBegin(12, 110); |
| eventSender.gestureScrollUpdate(0, -60); |
| eventSender.gestureScrollEnd(0, 0); |
| |
| // Wait for layout. |
| checkScrollOffset(); |
| } |
| |
| if (window.testRunner) |
| testRunner.waitUntilDone(); |
| |
| function runTest() |
| { |
| touchtarget = document.getElementById('touchtarget'); |
| touchtarget.contentDocument.addEventListener("scroll", recordScroll); |
| touchtarget.contentDocument.body.addEventListener("mousewheel", recordWheel); |
| |
| if (window.eventSender) { |
| description('This tests gesture event scrolling in iframes. ' + |
| 'Red-green strip is scrolled on pass.'); |
| if (checkTestDependencies()) |
| firstGestureScroll(); |
| else |
| exitIfNecessary(); |
| } else { |
| debug("This test requires DumpRenderTree . Touch-scroll the red/green strip."); |
| } |
| } |
| </script> |
| </body> |
| </html> |