| <!DOCTYPE html> |
| <body> |
| <script src="../../../resources/testharness.js"></script> |
| <script src="../../../resources/testharnessreport.js"></script> |
| <script src="../resources/common.js"></script> |
| <div id="log"></div> |
| |
| <p>This tests dragging text from a textarea element to an input element.</p> |
| <p>When the test is run, the follow textarea should be empty:</p> |
| <p><textarea id="textarea" cols="50" rows="10">drag this text into the text field above</textarea></p> |
| <p>And the following input should have text in it:</p> |
| <p><input id="input" type="text" size="50"></p> |
| <p id="result">If the test has completed this sentence should be replaced by a success message.</p> |
| |
| <script> |
| if (!window.eventSender) |
| document.body.textContent = "Require window.eventSender."; |
| |
| test(function() { |
| var textarea = document.getElementById("textarea"); |
| var input = document.getElementById("input"); |
| |
| textarea.select(); |
| hoverOverElement(textarea); |
| eventSender.mouseDown(); |
| // Leap the event time so that mouseMove will start a new drag instead of changing selection. |
| eventSender.leapForward(400); |
| hoverOverElement(input); |
| eventSender.mouseUp(); |
| |
| assert_equals(input.value, "drag this text into the text field above"); |
| assert_equals(textarea.value, ""); |
| }, "Test to drag TEXTAREA text to INPUT."); |
| </script> |
| </body> |