Use testRunner instead of layoutTestController in fast/doctypes, dom, dynamic, encodi...
[WebKit-https.git] / LayoutTests / fast / events / touch / gesture / context-menu-on-two-finger-tap.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../js/resources/js-test-pre.js"></script>
5 </head>
6 <body onload="test()">
7 <p>This test checks that the context menu is shown on a two finger tap gesture.</p>
8 <div id="text">Testing</div>
9 <div id="result">FAIL</div>
10 <script>
11 function test()
12 {
13     if (window.testRunner)
14         testRunner.dumpAsText();
15
16     document.oncontextmenu = function() { document.getElementById("result").innerHTML = "PASS"; }
17
18     var text = document.getElementById("text");
19
20     var x = text.offsetParent.offsetLeft + text.offsetLeft + 4;
21     var y = text.offsetParent.offsetTop + text.offsetTop + text.offsetHeight / 2;
22
23     if (!window.eventSender)
24         return;
25     if (eventSender.gestureTwoFingerTap) {
26         eventSender.gestureTwoFingerTap(x, y);
27     } else {
28         debug("gestureTwoFingerTap not implemented by this platform");
29         return;
30     }
31 }
32 </script>
33 </body>
34 </html>