4 <script src=
"../../resources/js-test.js"></script>
6 #div1 {width:
350px;height:
70px;padding:
10px;border:
1px solid #aaaaaa;}
7 #drag1{width:
170px;height:
36px;display:block;}
11 <p>Drag the following text into the rectangle:
</p>
14 <div id=
"drag1" draggable=
"true">Drag me
</div>
15 <pre id=
"console"></pre>
17 window
.jsTestIsAsync
= true;
18 description("Test that drop event generates user gesture");
20 if (window
.testRunner
) {
21 testRunner
.setCloseRemainingWindowsWhenComplete(true);
22 testRunner
.setCanOpenWindows();
23 testRunner
.setPopupBlockingEnabled(true);
27 // Consume user gesture.
28 shouldBeDefined("window.open('about:blank')");
32 function allowDrop(ev
) {
36 document
.getElementById("div1").addEventListener("dragover", allowDrop
);
37 document
.getElementById("div1").addEventListener("drop", drop
);
39 if (window
.eventSender
) {
40 var drag
= document
.querySelector("#drag1");
41 eventSender
.mouseMoveTo(drag
.offsetLeft
+ 10, drag
.offsetTop
+ 5);
42 eventSender
.mouseDown();
43 eventSender
.leapForward(100);
44 eventSender
.mouseMoveTo(drag
.offsetLeft
+ 10, drag
.offsetTop
- 30);
45 eventSender
.mouseUp();