Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / touch / touch-inside-iframe-scrolled.html
blob1e0c6e9d4b1d37614f18dbfaaf9c2a9e6cd2079d
1 <html>
2 <script src="../../../resources/js-test.js"></script>
3 <body>
4 <iframe style="position:absolute; top:100px; left:100px;" src="./resources/touch-inside-iframe-scrolled2.html"></iframe>
5 <p id="description"></p>
6 <div id="console"></div>
7 <script type="text/javascript">
8 description('Test iframes receive touches correctly when scrolled. https://bugs.webkit.org/show_bug.cgi?id=96541');
10 var touch = null;
11 var correctDiv = false;
13 function testComplete(hitCorrectDiv, event)
15 correctDiv = hitCorrectDiv;
16 shouldBeTrue("correctDiv");
18 touch = event.touches[0];
19 shouldBe("touch.pageX", "150");
20 shouldBe("touch.pageY", "350");
22 isSuccessfullyParsed();
23 testRunner.notifyDone();
26 // Backstop to prevent test timeout on incorrect position
27 document.addEventListener('touchstart', function(event) {
28 parent.testComplete(false, event);
29 }, false);
31 function runTest() {
32 if (window.eventSender) {
33 // Touch the center of the div in the iframe.
34 // 100px is offset to iframe in main frame,
35 // 2px for the iframe border, 50px to get to centre of the div.
36 eventSender.addTouchPoint(152, 152);
37 eventSender.touchStart();
38 } else {
39 debug('This test requires DRT.');
43 if (window.testRunner) {
44 testRunner.waitUntilDone();
46 </script>
47 </body>
48 </html>