Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / touch / gesture / touch-gesture-scroll-iframe.html
blob90dfc5f6f4b34f882d1ffd8f78c78b4602230c32
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../../resources/js-test.js"></script>
5 <script src="resources/gesture-helpers.js"></script>
6 <style type="text/css">
7 #touchtarget {
8 width: 200px;
9 height: 200px;
10 position: relative;
11 background: white;
14 ::-webkit-scrollbar {
15 width: 0px;
16 height: 0px;
19 </style>
20 </head>
21 <body>
22 <iframe id="touchtarget" src="resources/scroll-inside-iframe.html"></iframe>
23 <p id="description"></p>
24 <div id="console"></div>
25 <script type="text/javascript">
27 var touchtarget;
28 var expectedGesturesTotal = 2;
29 var gesturesOccurred = 0;
30 var scrollAmountX = ['0', '0'];
31 var scrollAmountY = ['140', '200'];
32 var wheelEventsOccurred = 0;
33 var expectedWheelEventsOccurred = ['0', '0'];
34 var scrollEventsOccurred = 0;
35 var expectedScrollEventsOccurred = '1';
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);
45 // Wait for layout.
46 checkScrollOffset();
49 function secondGestureScroll()
51 debug("second gesture");
52 eventSender.gestureScrollBegin(12, 110);
53 eventSender.gestureScrollUpdate(0, -60);
54 eventSender.gestureScrollEnd(0, 0);
56 // Wait for layout.
57 checkScrollOffset();
60 if (window.testRunner)
61 testRunner.waitUntilDone();
63 function runTest()
65 touchtarget = document.getElementById('touchtarget');
66 touchtarget.contentDocument.addEventListener("scroll", recordScroll);
67 touchtarget.contentDocument.body.addEventListener("mousewheel", recordWheel);
69 if (window.eventSender) {
70 description('This tests gesture event scrolling in iframes. ' +
71 'Red-green strip is scrolled on pass.');
72 if (checkTestDependencies())
73 firstGestureScroll();
74 else
75 exitIfNecessary();
76 } else {
77 debug("This test requires DumpRenderTree . Touch-scroll the red/green strip.");
80 </script>
81 </body>
82 </html>