1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../../../resources/js-test.js"></script>
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 <div id=
"eventSequence">Event sequence:
</div>
16 if (window
.testRunner
)
17 testRunner
.dumpAsText();
19 document
.oncontextmenu = function() {
20 document
.getElementById("result").innerHTML
= "PASS (ContextMenu event seen)";
23 for (let evtType
of ["contextmenu", "mouseover", "mousemove", "mouseout",
24 "mouseenter", "mouseleave", "mouseup", "mousedown"]) {
25 document
.addEventListener(evtType
, function(e
) {
26 document
.getElementById("eventSequence").innerHTML
+= " " + e
.type
;
30 var text
= document
.getElementById("text");
32 var x
= text
.offsetParent
.offsetLeft
+ text
.offsetLeft
+ 4;
33 var y
= text
.offsetParent
.offsetTop
+ text
.offsetTop
+ text
.offsetHeight
/ 2;
35 if (!window
.eventSender
)
37 if (eventSender
.gestureTwoFingerTap
) {
38 eventSender
.gestureTwoFingerTap(x
, y
);
40 debug("gestureTwoFingerTap not implemented by this platform");