5 if (window
.testRunner
) {
6 testRunner
.dumpAsText();
7 testRunner
.waitUntilDone();
12 var dropTarget
= document
.getElementById("drop-target");
13 dropTarget
.addEventListener("dragleave", function() {
14 dropTarget
.style
.display
= "none";
17 if (window
.eventSender
) {
18 eventSender
.beginDragWithFiles(["resources/abe.png"]);
19 var x
= dropTarget
.offsetLeft
+ dropTarget
.offsetWidth
/ 2;
20 var y
= dropTarget
.offsetTop
+ dropTarget
.offsetHeight
/ 2;
21 eventSender
.mouseMoveTo(x
, y
);
22 eventSender
.mouseMoveTo(0, 0);
24 // The test harness wants us to call eventSender.mouseUp() before finishing,
25 // but we need to not navigate when that happens, so add a drop handler that
26 // prevents navigation.
27 window
.addEventListener("dragover", function() {
28 event
.preventDefault();
30 window
.addEventListener("drop", function() {
31 event
.preventDefault();
33 eventSender
.mouseUp();
36 if (window
.testRunner
)
37 testRunner
.notifyDone();
41 <body onload=
"test()">
42 <p>This test passes if there is no crash when dragging a file over and then away from the file input element below.
</p>
43 <input type=
"file" id=
"drop-target">