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 long tap gesture.
</p>
8 <div id=
"text" draggable='true'
>Testing
</div>
9 <div id=
"dragresult">FAIL
</div>
10 <div id=
"result">FAIL
</div>
14 if (window
.testRunner
)
15 testRunner
.dumpAsText();
18 internals
.settings
.setTouchDragDropEnabled(true);
20 document
.ondragstart = function() { document
.getElementById("dragresult").innerHTML
= "PASS"; }
21 document
.oncontextmenu = function() { document
.getElementById("result").innerHTML
= "PASS"; }
23 var text
= document
.getElementById("text");
25 var x
= text
.offsetParent
.offsetLeft
+ text
.offsetLeft
+ 4;
26 var y
= text
.offsetParent
.offsetTop
+ text
.offsetTop
+ text
.offsetHeight
/ 2;
28 if (!window
.eventSender
)
30 if (eventSender
.gestureLongTap
) {
31 // Send long press first on the draggable div to start a drag. This
32 // will enable context menu on the subsequent long tap.
33 eventSender
.gestureLongPress(x
, y
);
34 eventSender
.gestureLongTap(x
, y
);
36 debug("gestureLongTap not implemented by this platform");