1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../../../resources/js-test.js"></script>
7 <p>This test checks that a long press gesture on a draggable element starts a drag/drop session.
</p>
8 <div id=
"text">Testing
</div>
9 <div id=
"dragResult">FAIL
</div>
10 <div id=
"mouseDownResult">PASS
</div>
11 <div id=
"draggableDiv" draggable='true'
>Drag me
</div>
15 if (window
.testRunner
)
16 testRunner
.dumpAsText();
19 internals
.settings
.setTouchDragDropEnabled(true);
21 var dragableDiv
= document
.getElementById("draggableDiv");
23 var x
= draggableDiv
.offsetParent
.offsetLeft
+ draggableDiv
.offsetLeft
+ 4;
24 var y
= draggableDiv
.offsetParent
.offsetTop
+ draggableDiv
.offsetTop
+ draggableDiv
.offsetHeight
/ 2;
26 document
.ondragstart = function(e
) {
27 if (e
.x
== x
&& e
.y
== y
)
28 document
.getElementById("dragResult").innerHTML
= "PASS";
30 document
.onmousedown = function() { document
.getElementById("mouseDownResult").innerHTML
= "FAIL"; };
32 if (!window
.eventSender
)
34 if (eventSender
.gestureLongPress
) {
35 eventSender
.gestureLongPress(x
, y
);
37 debug("gestureLongPress not implemented by this platform");