Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / drag-drop-iframe-refresh-crash.html
blobdb06ee5f77b064412231dcf4402e5202636581a5
1 <html>
2 <head>
3 <script>
4 if (window.testRunner) {
5 testRunner.waitUntilDone();
6 testRunner.dumpAsText();
9 function log(message) {
10 var console = document.getElementById("console");
11 var li = document.createElement("li");
12 var text = document.createTextNode(message);
14 console.appendChild(li);
15 li.appendChild(text);
18 function runTest() {
20 var doc = window.frames[0].document;
21 e = doc.getElementById("dragme");
22 xdrag = e.offsetLeft + e.offsetWidth / 2;
23 ydrag = e.offsetTop + e.offsetHeight / 2;
24 e = doc.getElementById("target");
25 xdrop = e.offsetLeft + e.offsetWidth / 2;
26 ydrop = e.offsetTop + e.offsetHeight / 2;
28 var timer = setInterval(function() {
29 window.frames[0].location = "../resources/drag-drop.html";
30 }, 100);
32 if (!window.testRunner) {
33 log("This test uses eventSender. To run it manually, drag the selected image to another position in the editable div and drop it. Renderer should not crash.");
34 return;
37 var max_tries = 50;
38 for (i = 0; i < max_tries; i++) {
39 eventSender.mouseMoveTo(xdrag, ydrag);
40 eventSender.mouseDown();
41 eventSender.mouseMoveTo(xdrop, ydrop);
42 eventSender.mouseUp();
45 clearInterval(timer);
47 document.write("<p>Bug 37618: Crash when an image drag-drop operation happens inside a continuously refreshing iframe.</p>");
48 document.write("<p>SUCCESS</p>");
50 testRunner.notifyDone();
52 </script>
53 </head>
54 <body onload="runTest()">
55 <iframe src="../resources/drag-drop.html"></iframe>
56 <ul id="console"></ul>
57 </body>
58 </html>