summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/events/touch/touch-inside-iframe.html
blob: b9162c398a59fc2d08f47854fe2810e6d799e2b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<html>
<link rel="stylesheet" href="../../js/resources/js-test-style.css">
<script src="../../js/resources/js-test-pre.js"></script>
<script src="../../js/resources/js-test-post-function.js"></script>
<body>
<iframe style="position:absolute; top:100px; left:100px;" src="./resources/touch-inside-iframe2.html"></iframe>
<p id="description"></p>
<div id="console"></div>
<script type="text/javascript">
description('Test iframes receive touches correctly.');

var touch = null;

function testComplete(event)
{
    touch = event.touches[0];
    shouldBe("touch.pageX", "50");
    shouldBe("touch.pageY", "50");
    isSuccessfullyParsed();
    layoutTestController.notifyDone();
}

function runTest() {
    if (window.eventSender) {
        // Touch the center of the div in the iframe.
        // 100px is offset to iframe in main frame,
        // 2px for the iframe border, 50px to get to centre of the div.
        eventSender.addTouchPoint(152, 152);
        eventSender.touchStart();
    } else {
       debug('This test requires DRT.');
    }
}

if (window.layoutTestController) {
    layoutTestController.waitUntilDone();
}

var successfullyParsed = true;
</script>
</body>
</html>