11 <body onload=
"test();">
13 <embed id=
"plugin_drag" type=
"application/x-webkit-test-webplugin" can-process-drag=
"true" contentEditable=
"false"></embed>
14 <embed id=
"plugin_editable" type=
"application/x-webkit-test-webplugin" contentEditable=
"true"></embed>
15 <embed id=
"plugin" type=
"application/x-webkit-test-webplugin"></embed>
16 <div id='text'
><span>Some text to drag
</span></div>
19 function dragOverPlugin(plugin
) {
20 var div
= document
.getElementById('text');
22 getSelection().collapse(div
, 0);
23 getSelection().modify('extend', 'forward', 'word');
25 console
.log("Dragging over " + plugin
.id
);
26 var positionX
= plugin
.offsetLeft
+ plugin
.offsetWidth
/ 2;
27 var positionY
= plugin
.offsetTop
+ plugin
.offsetHeight
/ 2;
29 var startX
= div
.offsetLeft
+ div
.firstChild
.offsetWidth
/ 5;
30 var startY
= div
.offsetTop
+ div
.offsetHeight
/ 2;;
32 // Drag into the plugin and drag out before dropping.
33 eventSender
.dragMode
= true;
34 eventSender
.mouseMoveTo(startX
, startY
);
35 eventSender
.mouseDown();
36 eventSender
.leapForward(250);
37 eventSender
.mouseMoveTo(positionX
, positionY
);
38 eventSender
.mouseMoveTo(positionX
+ 2, positionY
);
39 eventSender
.mouseMoveTo(startX
, startY
);
40 eventSender
.mouseMoveTo(positionX
, positionY
);
41 eventSender
.mouseUp();
42 eventSender
.leapForward(250);
43 eventSender
.mouseMoveTo(startX
, startY
);
47 if (!window
.testRunner
|| !window
.eventSender
) {
48 document
.write("This test does not work in manual mode.");
50 testRunner
.dumpAsText();
51 dragOverPlugin(plugin_drag
);
52 dragOverPlugin(plugin_editable
);
53 dragOverPlugin(plugin
);