Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: LayoutTests/platform/chromium/plugins/drag-events.html

Issue 14120003: Move LayoutTests from platform/chromium/... to generic location (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <style>
4 #plugin {
5 width: 150px;
6 height: 150px;
7 }
8 </style>
9 </head>
10
11 <body onload="test();">
12
13 <embed id="plugin_drag" type="application/x-webkit-test-webplugin" can-process-d rag="true" contentEditable="false"></embed>
14 <embed id="plugin_editable" type="application/x-webkit-test-webplugin" contentEd itable="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>
18
19 function dragOverPlugin(plugin) {
20 var div = document.getElementById('text');
21 div.focus();
22 getSelection().collapse(div, 0);
23 getSelection().modify('extend', 'forward', 'word');
24
25 console.log("Dragging over " + plugin.id);
26 var positionX = plugin.offsetLeft + plugin.offsetWidth / 2;
27 var positionY = plugin.offsetTop + plugin.offsetHeight / 2;
28
29 var startX = div.offsetLeft + div.firstChild.offsetWidth / 5;
30 var startY = div.offsetTop + div.offsetHeight / 2;;
31
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);
44 }
45
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);
54 }
55 }
56 </script>
57 </body>
58 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698