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

Side by Side Diff: LayoutTests/fast/forms/textarea-maxlength.html

Issue 16818023: DOMException toString is not correct (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 6 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
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../fast/js/resources/js-test-pre.js"></script> 4 <script src="../../fast/js/resources/js-test-pre.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <p id="description"></p> 7 <p id="description"></p>
8 <div id="console"></div> 8 <div id="console"></div>
9 <script> 9 <script>
10 description('Tests for HTMLTextAreaElement.maxLength behaviors.'); 10 description('Tests for HTMLTextAreaElement.maxLength behaviors.');
(...skipping 13 matching lines...) Expand all
24 // Valid maxlength attributes 24 // Valid maxlength attributes
25 textArea.setAttribute('maxlength', '1'); 25 textArea.setAttribute('maxlength', '1');
26 shouldBe('textArea.maxLength', '1'); 26 shouldBe('textArea.maxLength', '1');
27 textArea.setAttribute('maxlength', '256'); 27 textArea.setAttribute('maxlength', '256');
28 shouldBe('textArea.maxLength', '256'); 28 shouldBe('textArea.maxLength', '256');
29 29
30 // Set values to .maxLength 30 // Set values to .maxLength
31 textArea.maxLength = 13; 31 textArea.maxLength = 13;
32 shouldBe('textArea.getAttribute("maxlength")', '"13"'); 32 shouldBe('textArea.getAttribute("maxlength")', '"13"');
33 33
34 shouldThrow('textArea.maxLength = -1', '"Error: IndexSizeError: DOM Exception 1" '); 34 shouldThrow('textArea.maxLength = -1', '"IndexSizeError: Index or size was negat ive, or greater than the allowed value."');
35 shouldBe('textArea.getAttribute("maxlength")', '"13"'); // Not changed 35 shouldBe('textArea.getAttribute("maxlength")', '"13"'); // Not changed
36 36
37 textArea.maxLength = null; 37 textArea.maxLength = null;
38 shouldBe('textArea.maxLength', '0'); 38 shouldBe('textArea.maxLength', '0');
39 shouldBe('textArea.getAttribute("maxlength")', '"0"'); 39 shouldBe('textArea.getAttribute("maxlength")', '"0"');
40 40
41 // maxLength doesn't truncate the default value. 41 // maxLength doesn't truncate the default value.
42 textArea = document.createElement('textarea'); 42 textArea = document.createElement('textarea');
43 textArea.setAttribute('maxlength', '3'); 43 textArea.setAttribute('maxlength', '3');
44 textArea.innerHTML = 'abcd'; 44 textArea.innerHTML = 'abcd';
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 // In the case maxlength='invalid' 158 // In the case maxlength='invalid'
159 createFocusedTextAreaWithMaxLength('invalid'); 159 createFocusedTextAreaWithMaxLength('invalid');
160 textArea.value = ''; 160 textArea.value = '';
161 document.execCommand('insertText', false, 'ABC'); 161 document.execCommand('insertText', false, 'ABC');
162 shouldBe('textArea.value', '"ABC"'); 162 shouldBe('textArea.value', '"ABC"');
163 </script> 163 </script>
164 <script src="../../fast/js/resources/js-test-post.js"></script> 164 <script src="../../fast/js/resources/js-test-post.js"></script>
165 </body> 165 </body>
166 </html> 166 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/setrangetext-expected.txt ('k') | LayoutTests/fast/forms/textarea-maxlength-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698