Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / drag-drop-copy-text.html
blobd1c119247cb9beb5b2b6cdd8482f351cf3403de3
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
4 <textarea id=textarea rows=1>Hello World</textarea>
5 <script>
6 description("This tests that text is copied (rather than moved) when the copy key is down.");
8 if (window.testRunner) {
9 // Drag a word in the textarea
10 var textarea = document.getElementById("textarea");
11 textarea.setSelectionRange(0, 5);
12 x = textarea.offsetLeft + 10;
13 y = textarea.offsetTop + textarea.offsetHeight / 2;
14 eventSender.mouseMoveTo(x, y);
15 eventSender.mouseDown();
16 // and drop it off to the right
17 eventSender.leapForward(500);
18 eventSender.mouseMoveTo(textarea.offsetLeft +
19 textarea.offsetWidth - 10, y);
21 // Simulate pressing the copy key. This will
22 // transform the drag into a copy, rather
23 // than a move.
24 eventSender.mouseUp(0, ["copyKey"]);
26 shouldBeEqualToString("textarea.value", "Hello WorldHello");
28 </script>