Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / plugins / drag-events.html
blobefabab60f7e1605a04f90bac28a0c04aa55e908c
1 <html>
2 <head>
3 <style>
4 #plugin {
5 width: 150px;
6 height: 150px;
8 </style>
9 </head>
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>
17 <script>
19 function dragOverPlugin(plugin) {
20 var div = document.getElementById('text');
21 div.focus();
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);
46 function test() {
47 if (!window.testRunner || !window.eventSender) {
48 document.write("This test does not work in manual mode.");
49 } else {
50 testRunner.dumpAsText();
51 dragOverPlugin(plugin_drag);
52 dragOverPlugin(plugin_editable);
53 dragOverPlugin(plugin);
56 </script>
57 </body>
58 </html>