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

Unified Diff: LayoutTests/editing/pasteboard/paste-newline-in-all-selected-textarea.html

Issue 113663003: Keep br while replacing plain texts with content ending with newline (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add test case for paste newline in a all selected textarea Created 7 years 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 side-by-side diff with in-line comments
Download patch
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..e5b88ec53362cdd55eb939dd44071fa5a798d20f
--- /dev/null
+++ b/LayoutTests/editing/pasteboard/paste-newline-in-all-selected-textarea.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<body>
+<textarea id="test" cols=5 rows=4>
+test
+
+</textarea>
+<script src="../../resources/js-test.js"></script>
+<script>
+
yosin_UTC9 2013/12/20 01:23:06 nit: Please remove an extra blank line.
ziran.sun 2014/01/02 16:03:30 Done.
+if (window.testRunner)
+ testRunner.dumpAsText();
yosin_UTC9 2013/12/20 01:23:06 You don't need to call testRunner.dumpAsText(). js
ziran.sun 2014/01/02 16:03:30 Done.
+
+var newlineText = '\n';
yosin_UTC9 2013/12/20 01:23:06 nit: We don't need to use |newlineText|.
ziran.sun 2014/01/02 16:03:30 Done.
+var textarea = document.getElementById("test");
+textarea.focus();
+
+//copy a new line
yosin_UTC9 2013/12/20 01:23:06 nit: Please put a space after "//"
ziran.sun 2014/01/02 16:03:30 Done.
+textarea.setSelectionRange(4, 5);
+document.execCommand("copy");
+
+document.execCommand("SelectAll");
+document.execCommand("paste");
+shouldBeEqualToString('textarea.value', newlineText);
+
yosin_UTC9 2013/12/20 01:23:06 nit: Please remove an extra blank line.
ziran.sun 2014/01/02 16:03:30 Done.
+</script>
+</body>
+</html>
+

Powered by Google App Engine
This is Rietveld 408576698