OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script> |
| 4 if (window.layoutTestController) { |
| 5 layoutTestController.waitUntilDone(); |
| 6 layoutTestController.dumpAsText(); |
| 7 } |
| 8 |
| 9 function log(message) { |
| 10 var console = document.getElementById("console"); |
| 11 var li = document.createElement("li"); |
| 12 var text = document.createTextNode(message); |
| 13 |
| 14 console.appendChild(li); |
| 15 li.appendChild(text); |
| 16 } |
| 17 |
| 18 function runTest() { |
| 19 |
| 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; |
| 27 |
| 28 var timer = setInterval(function() { |
| 29 window.frames[0].location = "../resources/drag-d
rop.html"; |
| 30 }, 100); |
| 31 |
| 32 if (!window.layoutTestController) { |
| 33 log("This test uses eventSender. To run it manually, drag the selected i
mage to another position in the editable div and drop it. Renderer should not cr
ash."); |
| 34 return; |
| 35 } |
| 36 |
| 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(); |
| 43 } |
| 44 |
| 45 clearInterval(timer); |
| 46 |
| 47 document.write("<p>Bug 37618: Crash when an image drag-drop operation happen
s inside a continuously refreshing iframe.</p>"); |
| 48 document.write("<p>SUCCESS</p>"); |
| 49 |
| 50 layoutTestController.notifyDone(); |
| 51 } |
| 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> |
OLD | NEW |