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

Unified Diff: LayoutTests/editing/deleting/delete-last-char-in-textarea.html

Issue 15011008: Don't insert rednant placeholder for text control after deleting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-05-10T19:11 Created 7 years, 7 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: LayoutTests/editing/deleting/delete-last-char-in-textarea.html
diff --git a/LayoutTests/editing/deleting/delete-last-char-in-textarea.html b/LayoutTests/editing/deleting/delete-last-char-in-textarea.html
new file mode 100644
index 0000000000000000000000000000000000000000..c7c7188cef02e05863084686b97d2a4f19c09be1
--- /dev/null
+++ b/LayoutTests/editing/deleting/delete-last-char-in-textarea.html
@@ -0,0 +1,30 @@
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<body>
+</body>
+<script>
+description('Check there is no placeholder after deleteing last char. You should run this in DRT.');
+var editable;
+
+function getEditRoot(element) {
+ return window.testRunner ? internals.shadowRoot(element) : document.body;
+}
+
+function testIt(tagName, value, expected) {
+ var control = document.createElement(tagName);
+ document.body.appendChild(control);
+ control.value = value;
+ control.focus();
+ control.setSelectionRange(control.value.length, control.value.length);
+ document.execCommand('Delete');
+ editable = getEditRoot(control).firstChild;
+ shouldBeEqualToString('editable.innerHTML', expected);
+ control.parentNode.removeChild(control);
+}
+testIt('input', 'az', 'a');
+testIt('input', 'z', '');
+testIt('textarea', 'z', '');
+testIt('textarea', '\nz', '<br>');
+testIt('textarea', 'a\n', 'a<br>');
+testIt('textarea', 'line 1\nz', 'line 1<br>');
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>

Powered by Google App Engine
This is Rietveld 408576698