| OLD | NEW |
| (Empty) |
| 1 <script> | |
| 2 | |
| 3 function runTest() { | |
| 4 var input = document.getElementById("input"); | |
| 5 var x = input.offsetLeft + input.offsetWidth / 2; | |
| 6 var y = input.offsetTop + input.offsetHeight / 2; | |
| 7 | |
| 8 var textarea = document.getElementById("textarea"); | |
| 9 var tx = textarea.offsetLeft + textarea.offsetWidth / 2; | |
| 10 var ty = textarea.offsetTop + textarea.offsetHeight / 2; | |
| 11 | |
| 12 input.select(); | |
| 13 | |
| 14 if (!window.testRunner) | |
| 15 return; | |
| 16 if (!window.eventSender) | |
| 17 return; | |
| 18 | |
| 19 testRunner.dumpAsText(); | |
| 20 testRunner.waitUntilDone(); | |
| 21 | |
| 22 eventSender.mouseMoveTo(x, y); | |
| 23 eventSender.mouseDown(); | |
| 24 // Leap the event time so that mouseMove will start a new drag instead of ch
anging selection. | |
| 25 eventSender.leapForward(400); | |
| 26 eventSender.mouseMoveTo(tx, ty); | |
| 27 eventSender.mouseUp(); | |
| 28 | |
| 29 if (input.value == "" && textarea.value == "drag this text into the text are
a below") | |
| 30 document.getElementById("result").innerText = "Test succeeded!"; | |
| 31 else | |
| 32 document.getElementById("result").innerText = "Test failed! Input value
was " + input.value + " and text area value was " + textarea.value + "."; | |
| 33 | |
| 34 testRunner.notifyDone(); | |
| 35 } | |
| 36 | |
| 37 </script> | |
| 38 | |
| 39 <body onload="runTest()"> | |
| 40 | |
| 41 <p>This tests dragging text from an input element into a text area element.</p> | |
| 42 <p>When the test is run, the follow text field should be empty:</p> | |
| 43 <p><input id="input" type="text" value="drag this text into the text area below"
size="50"></p> | |
| 44 <p>And the following text area should have text in it:</p> | |
| 45 <p><textarea id="textarea" cols="50" rows="10"></textarea></p> | |
| 46 <p id="result">If the test has completed this sentence should be replaced by a s
uccess message.</p> | |
| 47 | |
| 48 </body> | |
| OLD | NEW |