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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-value-last-eol.html

Issue 1785603002: TEXTAREA: Cutting last line without EOL should not remove the remaining EOL in the previous line. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove an ASSERT, update a comment Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-value-last-eol.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-value-last-eol.html b/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-value-last-eol.html
index 1664f53022d33a929664b18bf62b0bb5516a8566..5ccc943a8188f838a9784b8568949c9a86d5b198 100644
--- a/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-value-last-eol.html
+++ b/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-value-last-eol.html
@@ -14,10 +14,28 @@ test(function() {
assert_equals(textarea.value, 'H\nW');
textarea.setSelectionRange(2, 3); // "W"
document.execCommand('cut');
+ assert_equals(textarea.value, 'H\n');
textarea.setSelectionRange(0, 0);
document.execCommand('paste');
- // TODO(tkent): The following assertion fails now. crbug.com/522144.
assert_equals(textarea.value, 'WH\n');
}, 'TEXTAREA should not remove the last EOL on paste.');
+
+test(function() {
+ var textarea1 = document.createElement('textarea');
+ document.body.appendChild(textarea1);
+ textarea1.focus();
+ textarea1.addEventListener('copy', function(event) {
+ event.clipboardData.setData('text', 'foo\n');
+ event.preventDefault();
+ });
+ document.execCommand('copy');
+
+ // Use another TEXAREA. We need a clean one.
+ var textarea2 = document.createElement('textarea');
+ document.body.appendChild(textarea2);
+ textarea2.focus();
+ document.execCommand('paste');
+ assert_equals(textarea2.value, 'foo\n');
+}, 'Pasting text ending \\n should not add another \\n.');
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698