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

Side by Side Diff: LayoutTests/fast/forms/ValidityState-customError.html

Issue 1220833002: Make the setCustomValidity() error argument not nullable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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
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="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.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 9
10 <fieldset name="set" id="fieldset-set"></fieldset> 10 <fieldset name="set" id="fieldset-set"></fieldset>
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 for (i = 0; i < v.length; i++) { 97 for (i = 0; i < v.length; i++) {
98 v[i].setCustomValidity("Custom string"); 98 v[i].setCustomValidity("Custom string");
99 try { 99 try {
100 v[i].setCustomValidity(); 100 v[i].setCustomValidity();
101 testFailed("setCustomValidity() did not throw"); 101 testFailed("setCustomValidity() did not throw");
102 } catch(err) { 102 } catch(err) {
103 testPassed("setCustomValidity() threw " + err.message); 103 testPassed("setCustomValidity() threw " + err.message);
104 } 104 }
105 v[i].setCustomValidity(undefined); 105 v[i].setCustomValidity(undefined);
106 } 106 }
107 shouldBeFalse('customErrorFor("fieldset-many-changes")'); 107 shouldBeFalse('customErrorFor("fieldset-many-changes")');
philipj_slow 2015/07/07 11:48:52 Do you know why <fieldset> and <button> are behavi
tkent 2015/07/08 00:31:06 <fieldset> is not a candidate for constraint valid
philipj_slow 2015/07/08 08:08:46 Interesting, looks like HTMLFieldset.setCustomVali
108 shouldBeFalse('customErrorFor("button-many-changes")'); 108 shouldBeTrue('customErrorFor("button-many-changes")');
109 shouldBeFalse('customErrorFor("button-button-many-changes")'); 109 shouldBeFalse('customErrorFor("button-button-many-changes")');
110 shouldBeFalse('customErrorFor("button-reset-many-changes")'); 110 shouldBeFalse('customErrorFor("button-reset-many-changes")');
111 shouldBeFalse('customErrorFor("select-many-changes")'); 111 shouldBeTrue('customErrorFor("select-many-changes")');
112 shouldBeFalse('customErrorFor("textarea-many-changes")'); 112 shouldBeTrue('customErrorFor("textarea-many-changes")');
113 shouldBeFalse('customErrorFor("input-many-changes")'); 113 shouldBeTrue('customErrorFor("input-many-changes")');
114 shouldBeFalse('customErrorFor("input-submit-many-changes")'); 114 shouldBeTrue('customErrorFor("input-submit-many-changes")');
115 115
116 debug('Set with three arguments.'); 116 debug('Set with three arguments.');
117 for (i = 0; i < v.length; i++) 117 for (i = 0; i < v.length; i++)
118 v[i].setCustomValidity("one", "two", "three"); 118 v[i].setCustomValidity("one", "two", "three");
119 shouldBeFalse('customErrorFor("fieldset-many-changes")'); 119 shouldBeFalse('customErrorFor("fieldset-many-changes")');
120 shouldBeTrue('customErrorFor("button-many-changes")'); 120 shouldBeTrue('customErrorFor("button-many-changes")');
121 shouldBeFalse('customErrorFor("button-button-many-changes")'); 121 shouldBeFalse('customErrorFor("button-button-many-changes")');
122 shouldBeFalse('customErrorFor("button-reset-many-changes")'); 122 shouldBeFalse('customErrorFor("button-reset-many-changes")');
123 shouldBeTrue('customErrorFor("select-many-changes")'); 123 shouldBeTrue('customErrorFor("select-many-changes")');
124 shouldBeTrue('customErrorFor("textarea-many-changes")'); 124 shouldBeTrue('customErrorFor("textarea-many-changes")');
(...skipping 11 matching lines...) Expand all
136 shouldBeFalse('customErrorFor("textarea-many-changes")'); 136 shouldBeFalse('customErrorFor("textarea-many-changes")');
137 shouldBeFalse('customErrorFor("input-many-changes")'); 137 shouldBeFalse('customErrorFor("input-many-changes")');
138 shouldBeFalse('customErrorFor("input-submit-many-changes")'); 138 shouldBeFalse('customErrorFor("input-submit-many-changes")');
139 139
140 debug('Set some value, and set undefined.'); 140 debug('Set some value, and set undefined.');
141 for (i = 0; i < v.length; i++) { 141 for (i = 0; i < v.length; i++) {
142 v[i].setCustomValidity("Custom string"); 142 v[i].setCustomValidity("Custom string");
143 v[i].setCustomValidity(undefined); 143 v[i].setCustomValidity(undefined);
144 } 144 }
145 shouldBeFalse('customErrorFor("fieldset-many-changes")'); 145 shouldBeFalse('customErrorFor("fieldset-many-changes")');
146 shouldBeFalse('customErrorFor("button-many-changes")'); 146 shouldBeTrue('customErrorFor("button-many-changes")');
147 shouldBeFalse('customErrorFor("button-button-many-changes")'); 147 shouldBeFalse('customErrorFor("button-button-many-changes")');
148 shouldBeFalse('customErrorFor("button-reset-many-changes")'); 148 shouldBeFalse('customErrorFor("button-reset-many-changes")');
149 shouldBeFalse('customErrorFor("select-many-changes")'); 149 shouldBeTrue('customErrorFor("select-many-changes")');
150 shouldBeFalse('customErrorFor("textarea-many-changes")'); 150 shouldBeTrue('customErrorFor("textarea-many-changes")');
151 shouldBeFalse('customErrorFor("input-many-changes")'); 151 shouldBeTrue('customErrorFor("input-many-changes")');
152 shouldBeFalse('customErrorFor("input-submit-many-changes")'); 152 shouldBeTrue('customErrorFor("input-submit-many-changes")');
153 153
154 debug(''); 154 debug('');
155 </script> 155 </script>
156 </body> 156 </body>
157 </html> 157 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698