Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / drag-image-to-contenteditable-in-iframe.html
bloba1d14fdb046a39ce20bf6832a0ca3f953b7370d2
1 <html>
2 <head>
3 <script>
4 function log(message) {
5 var console = document.getElementById("console");
6 var li = document.createElement("li");
7 var text = document.createTextNode(message);
9 console.appendChild(li);
10 li.appendChild(text);
13 function runTest() {
14 if (!window.testRunner) {
15 log("To run this test manually attempt to drag and drop Abe after the broken image in the editable div");
16 return;
19 testRunner.waitUntilDone();
21 //find abe
22 var dragme = document.getElementById("dragme");
23 x1 = dragme.offsetLeft + 20;
24 y1 = dragme.offsetTop + 20;
26 // Find the target
27 var drag_target = document.getElementById("drag_target");
28 x2 = drag_target.offsetLeft + drag_target.offsetWidth / 2;
29 y2 = drag_target.offsetTop + drag_target.offsetHeight / 2;
31 // Drag abe into the editable
32 eventSender.mouseMoveTo(x1, y1);
33 eventSender.mouseDown();
34 eventSender.leapForward(500);
35 eventSender.mouseMoveTo(x2, y2);
36 eventSender.mouseUp();
38 testRunner.notifyDone();
41 </script>
42 <title>Dragging an image to the end of a content editable div in an iframe</title>
43 </head>
44 <body onload="runTest()">
45 <p>This tests that we can drag an image into the last position of a content editable div in an iframe that already contains an image, without crashing.</p>
47 <img id="dragme" src="../resources/abe.png"/>
48 <iframe id="drag_target" src="resources/drag-image-to-contenteditable-iframe.html"></iframe>
49 <ul id="console"></ul>
50 </body>
51 </html>