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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLOutputElement/dom-token-list.html

Issue 2898063003: DOMTokenList.contains() should not throw. (Closed)
Patch Set: Move the comment Created 3 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
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 <script> 7 <script>
8 // This test mostly comes from fast/dom/HTMLElement/script-tests/class-list.js 8 // This test mostly comes from fast/dom/HTMLElement/script-tests/class-list.js
9 description('Tests the htmlFor attribute and its properties.'); 9 description('Tests the htmlFor attribute and its properties.');
10 10
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 testFailed('Wrong exception code: ' + ex.code); 138 testFailed('Wrong exception code: ' + ex.code);
139 return; 139 return;
140 } 140 }
141 } 141 }
142 var formattedFunction = String(f).replace(/^function.+\{\s*/m, ''). 142 var formattedFunction = String(f).replace(/^function.+\{\s*/m, '').
143 replace(/;?\s+\}/m, ''); 143 replace(/;?\s+\}/m, '');
144 testPassed(formattedFunction + ' threw expected DOMException with code ' + e c); 144 testPassed(formattedFunction + ' threw expected DOMException with code ' + e c);
145 } 145 }
146 146
147 createElement('x'); 147 createElement('x');
148 shouldThrowDOMException(function() { 148 shouldNotThrow('element.htmlFor.contains("")');
149 element.htmlFor.contains('');
150 }, DOMException.SYNTAX_ERR);
151 149
152 createElement('x y'); 150 createElement('x y');
153 shouldThrowDOMException(function() { 151 shouldNotThrow('element.htmlFor.contains("x y")');
154 element.htmlFor.contains('x y');
155 }, DOMException.INVALID_CHARACTER_ERR);
156 152
157 createElement(''); 153 createElement('');
158 shouldThrowDOMException(function() { 154 shouldThrowDOMException(function() {
159 element.htmlFor.add(''); 155 element.htmlFor.add('');
160 }, DOMException.SYNTAX_ERR); 156 }, DOMException.SYNTAX_ERR);
161 157
162 createElement(''); 158 createElement('');
163 shouldThrowDOMException(function() { 159 shouldThrowDOMException(function() {
164 element.htmlFor.add('x y'); 160 element.htmlFor.add('x y');
165 }, DOMException.INVALID_CHARACTER_ERR); 161 }, DOMException.INVALID_CHARACTER_ERR);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 252
257 createElement('x'); 253 createElement('x');
258 shouldBeEqualToString('typeof element.htmlFor', 'object'); 254 shouldBeEqualToString('typeof element.htmlFor', 'object');
259 255
260 shouldEvaluateTo('element.htmlFor.constructor', 'DOMTokenList'); 256 shouldEvaluateTo('element.htmlFor.constructor', 'DOMTokenList');
261 257
262 shouldBeTrue('element.htmlFor === element.htmlFor'); 258 shouldBeTrue('element.htmlFor === element.htmlFor');
263 </script> 259 </script>
264 </body> 260 </body>
265 </html> 261 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698