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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <script src="../../fast/js/resources/js-test-pre.js"></script>
2 <body>
3 </body>
4 <script>
5 description('Check there is no placeholder after deleteing last char. You should run this in DRT.');
6 var editable;
7
8 function getEditRoot(element) {
9 return window.testRunner ? internals.shadowRoot(element) : document.body;
10 }
11
12 function testIt(tagName, value, expected) {
13 var control = document.createElement(tagName);
14 document.body.appendChild(control);
15 control.value = value;
16 control.focus();
17 control.setSelectionRange(control.value.length, control.value.length);
18 document.execCommand('Delete');
19 editable = getEditRoot(control).firstChild;
20 shouldBeEqualToString('editable.innerHTML', expected);
21 control.parentNode.removeChild(control);
22 }
23 testIt('input', 'az', 'a');
24 testIt('input', 'z', '');
25 testIt('textarea', 'z', '');
26 testIt('textarea', '\nz', '<br>');
27 testIt('textarea', 'a\n', 'a<br>');
28 testIt('textarea', 'line 1\nz', 'line 1<br>');
29 </script>
30 <script src="../../fast/js/resources/js-test-post.js"></script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698