Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: third_party/WebKit/LayoutTests/editing/pasteboard/drag-drop-copy-text.html

Issue 2270663002: Selection API of INPUT/TEXTAREA should not update FrameSelection without focusing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust more tests Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script> 2 <script src="../../resources/js-test.js"></script>
3 3
4 <textarea id=textarea rows=1>Hello World</textarea> 4 <textarea id=textarea rows=1>Hello World</textarea>
5 <script> 5 <script>
6 description("This tests that text is copied (rather than moved) when the copy ke y is down."); 6 description("This tests that text is copied (rather than moved) when the copy ke y is down.");
7 7
8 if (window.testRunner) { 8 if (window.testRunner) {
9 // Drag a word in the textarea 9 // Drag a word in the textarea
10 var textarea = document.getElementById("textarea"); 10 var textarea = document.getElementById("textarea");
11 textarea.focus();
11 textarea.setSelectionRange(0, 5); 12 textarea.setSelectionRange(0, 5);
12 x = textarea.offsetLeft + 10; 13 x = textarea.offsetLeft + 10;
13 y = textarea.offsetTop + textarea.offsetHeight / 2; 14 y = textarea.offsetTop + textarea.offsetHeight / 2;
14 eventSender.mouseMoveTo(x, y); 15 eventSender.mouseMoveTo(x, y);
15 eventSender.mouseDown(); 16 eventSender.mouseDown();
16 // and drop it off to the right 17 // and drop it off to the right
17 eventSender.leapForward(500); 18 eventSender.leapForward(500);
18 eventSender.mouseMoveTo(textarea.offsetLeft + 19 eventSender.mouseMoveTo(textarea.offsetLeft +
19 textarea.offsetWidth - 10, y); 20 textarea.offsetWidth - 10, y);
20 21
21 // Simulate pressing the copy key. This will 22 // Simulate pressing the copy key. This will
22 // transform the drag into a copy, rather 23 // transform the drag into a copy, rather
23 // than a move. 24 // than a move.
24 eventSender.mouseUp(0, ["copyKey"]); 25 eventSender.mouseUp(0, ["copyKey"]);
25 26
26 shouldBeEqualToString("textarea.value", "Hello WorldHello"); 27 shouldBeEqualToString("textarea.value", "Hello WorldHello");
27 } 28 }
28 </script> 29 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698