Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / touch / gesture / touch-gesture-scroll-iframe-editable.html
blob7e20efc225093fb910b84de9a403e5068cd8d3f4
1 <!DOCTYPE html>
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 background: white;
11 ::-webkit-scrollbar {
12 width: 0px;
13 height: 0px;
16 #container {
17 width: 200px;
18 height: 200px;
19 overflow-y: scroll;
20 overflow-x: scroll;
21 display: block;
24 </style>
25 </head>
26 <body>
27 <div id="container">
28 <iframe id="touchtarget" src="resources/scroll-inside-editable-iframe.html"></iframe>
29 </div>
30 <p id="description"></p>
31 <div id="console"></div>
32 <script type="text/javascript">
34 var touchtarget;
35 var expectedGesturesTotal = 2;
36 var gesturesOccurred = 0;
37 var scrollAmountX = ['0', '0'];
38 var scrollAmountY = ['140', '200'];
39 var wheelEventsOccurred = 0;
40 var expectedWheelEventsOccurred = ['0', '0'];
41 var scrollEventsOccurred = 0;
42 var expectedScrollEventsOccurred = '1';
43 var scrolledElement = 'touchtarget.contentDocument.scrollingElement'
45 function firstGestureScroll()
47 debug("first gesture");
48 eventSender.gestureScrollBegin(12, 150);
49 eventSender.gestureScrollUpdate(0, -140);
50 eventSender.gestureScrollEnd(0, 0);
52 // Wait for layout.
53 checkScrollOffset();
56 function secondGestureScroll()
58 debug("second gesture");
59 eventSender.gestureScrollBegin(12, 110);
60 eventSender.gestureScrollUpdate(0, -60);
61 eventSender.gestureScrollEnd(0, 0);
63 // Wait for layout.
64 checkScrollOffset();
67 if (window.testRunner)
68 testRunner.waitUntilDone();
70 function runTest()
72 touchtarget = document.getElementById('touchtarget');
73 touchtarget.contentDocument.addEventListener("scroll", recordScroll);
74 touchtarget.contentDocument.body.addEventListener("mousewheel", recordWheel);
76 if (window.eventSender) {
77 description('This tests gesture event scrolling of an iframe in an overflow div. ' +
78 'Red-green strip is scrolled on pass.');
79 if (checkTestDependencies())
80 firstGestureScroll();
81 else
82 exitIfNecessary();
83 } else {
84 debug("This test requires DumpRenderTree. Touch-scroll the red/green strip.");
87 </script>
88 </body>
89 </html>