Index: LayoutTests/editing/pasteboard/paste-newline-in-all-selected-textarea.html |
diff --git a/LayoutTests/editing/pasteboard/paste-newline-in-all-selected-textarea.html b/LayoutTests/editing/pasteboard/paste-newline-in-all-selected-textarea.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b21e1a16a63e93f103581abd577665a9835c4dc2 |
--- /dev/null |
+++ b/LayoutTests/editing/pasteboard/paste-newline-in-all-selected-textarea.html |
@@ -0,0 +1,23 @@ |
+<!DOCTYPE html> |
+<html> |
+<body> |
+<textarea id="test" cols=5 rows=4> |
+This test verifies that pasting a newline in a textarea with all text selected |
+produces a newline. |
+ |
+</textarea> |
+<script src="../../resources/js-test.js"></script> |
+<script> |
+var textarea = document.getElementById('test'); |
+textarea.focus(); |
+ |
+// copy a new line |
+textarea.setSelectionRange(99, 100); |
+document.execCommand('Copy'); |
+ |
+document.execCommand('SelectAll'); |
+document.execCommand('Paste'); |
+shouldBeEqualToString('textarea.value', '\n'); |
+</script> |
+</body> |
+</html> |