summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/plugins/touch-events-synthesized.html
blob: b1c9ab9dfca0c914944095e558e391e08685ca43 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
<html>
<head>
<style>
  #plugin {
    width: 150px;
    height: 150px;
  }
</style>
</head>

<body>
<embed id="touch_plugin" type="application/x-webkit-test-webplugin" accepts-touch="synthetic" print-event-details="true"></embed><embed id="plugin" type="application/x-webkit-test-webplugin"></embed>
<script>

    if (!window.testRunner || !window.eventSender) {
        document.write("This test does not work in manual mode.");
    } else {
        testRunner.dumpAsText();

        var positionX = plugin.offsetLeft + 10;
        var positionY = plugin.offsetTop + 10;
        eventSender.addTouchPoint(positionX, positionY);
        eventSender.touchStart();
        eventSender.releaseTouchPoint(0);
        eventSender.touchEnd();

        positionX = touch_plugin.offsetLeft + 10;
        positionY = touch_plugin.offsetTop + 10;
        eventSender.addTouchPoint(positionX, positionY);
        eventSender.touchStart();
        eventSender.updateTouchPoint(0, positionX + 10, positionY + 5);
        eventSender.touchMove();
        eventSender.releaseTouchPoint(0);
        eventSender.touchEnd();

        eventSender.zoomPageIn();
        eventSender.addTouchPoint(positionX, positionY);
        eventSender.touchStart();
        eventSender.updateTouchPoint(0, positionX + 10, positionY + 5);
        eventSender.touchMove();
        eventSender.releaseTouchPoint(0);
        eventSender.touchEnd();

        eventSender.zoomPageOut();
        eventSender.addTouchPoint(positionX, positionY);
        eventSender.touchStart();
        eventSender.updateTouchPoint(0, positionX + 10, positionY + 5);
        eventSender.touchMove();
        eventSender.releaseTouchPoint(0);
        eventSender.touchEnd();
    }

</script>
</body>
</html>