ojan@chromium.org | 0b530eb | 2010-03-12 18:18:40 +0000 | [diff] [blame] | 1 | <html> |
| 2 | <head> |
| 3 | <script src=../editing.js type="text/javascript"></script> |
| 4 | <script> |
| 5 | function editingTest() { |
| 6 | |
| 7 | if (!window.eventSender) |
| 8 | return; |
| 9 | doubleClickAtSelectionStart(); |
| 10 | |
| 11 | // Drag 'hello' |
| 12 | var e = document.getElementById("dragme"); |
| 13 | x = e.offsetLeft; |
| 14 | y = e.offsetTop + e.offsetHeight / 2; |
| 15 | eventSender.mouseMoveTo(x, y); |
| 16 | eventSender.mouseDown(); |
| 17 | // and drop it off to the right somewhere. |
| 18 | eventSender.leapForward(500); |
| 19 | eventSender.mouseMoveTo(x + 300, y); |
| 20 | eventSender.mouseUp(); |
| 21 | } |
| 22 | </script> |
| 23 | <title>Drag and drop within a text input field modifies page</title> |
| 24 | </head> |
| 25 | <body> |
| 26 | <p>Tests that drag/drop after double-click does a smart drag. Specifically the end result should have a space: "world hello". To test manually double click on the "hello" and drag it to after "world".</p> |
| 27 | <div contenteditable="true" id="test"><span id="dragme">hello</span> world</div> |
| 28 | <script>runEditingTest();</script> |
| 29 | </body> |
| 30 | </html> |