6 if (window
.testRunner
) {
7 testRunner
.dumpAsText();
8 testRunner
.waitUntilDone();
12 e
= document
.getElementById("source");
13 x
= e
.offsetLeft
+ e
.offsetWidth
/ 2;
14 y
= e
.offsetTop
+ e
.offsetHeight
/ 2;
16 eventSender
.mouseMoveTo(x
, y
);
17 eventSender
.mouseDown();
18 e
= document
.getElementById("target");
19 x
= e
.offsetLeft
+ e
.offsetWidth
/ 2;
20 y
= e
.offsetTop
+ e
.offsetHeight
/ 2;
22 eventSender
.mouseMoveTo(x
, y
);
23 eventSender
.mouseUp();
26 function dragEnterOrOver(event
) {
27 event
.dataTransfer
.dropEffect
= "copy";
28 event
.preventDefault();
31 function drop(event
) {
32 event
.preventDefault();
33 eventSender
.dumpFilenameBeingDragged();
34 testRunner
.notifyDone();
45 <body onload=
"runTest()">
47 <p>This test requires DumpRenderTree. To test manually, drag the image to the desktop. It should receive the name
"onload-image.png".
49 <div id=
"target" ondragenter=
"dragEnterOrOver(event)" ondragover=
"dragEnterOrOver(event)" ondrop=
"drop(event)"></div>
50 <img id=
"source" src=
"resources/onload-image.png" alt=
"Does it work?">