Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / touch / gesture / long-press-on-draggable-element-triggers-drag.html
blobd877a222e34b55aea5f8dace6f567304d3e1a69d
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../../resources/js-test.js"></script>
5 </head>
6 <body onload="test()">
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>
12 <script>
13 function test()
15 if (window.testRunner)
16 testRunner.dumpAsText();
18 if (window.internals)
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)
33 return;
34 if (eventSender.gestureLongPress) {
35 eventSender.gestureLongPress(x, y);
36 } else {
37 debug("gestureLongPress not implemented by this platform");
38 return;
41 </script>
42 </body>
43 </html>