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

Side by Side Diff: LayoutTests/fast/js/select-options-add-expected.txt

Issue 716773002: Use union types for HTMLSelectElement.add()'s arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: added FIXME Created 6 years, 1 month 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 This test checks the behavior of the add() method on the select.options object. 1 This test checks the behavior of the add() method on the select.options object.
2 It covers both the the one-argument (1.x) and two-argument (2.x) signatures of t he add() method. 2 It covers both the the one-argument (1.x) and two-argument (2.x) signatures of t he add() method.
3 3
4 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE ". 4 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE ".
5 5
6 6
7 1.1 Add Option to empty Options 7 1.1 Add Option to empty Options
8 PASS select1.options.length is 1 8 PASS select1.options.length is 1
9 PASS select1.selectedIndex is 0 9 PASS select1.selectedIndex is 0
10 PASS select1.options[0].value is '1' 10 PASS select1.options[0].value is '1'
(...skipping 11 matching lines...) Expand all
22 PASS select1.options.length is 3 22 PASS select1.options.length is 3
23 PASS select1.selectedIndex is 0 23 PASS select1.selectedIndex is 0
24 PASS select1.options[0].value is '1' 24 PASS select1.options[0].value is '1'
25 PASS select1.options[0].textContent is 'A' 25 PASS select1.options[0].textContent is 'A'
26 PASS select1.options[1].value is '2' 26 PASS select1.options[1].value is '2'
27 PASS select1.options[1].textContent is 'B' 27 PASS select1.options[1].textContent is 'B'
28 PASS select1.options[2].value is '3' 28 PASS select1.options[2].value is '3'
29 PASS select1.options[2].textContent is 'C' 29 PASS select1.options[2].textContent is 'C'
30 30
31 1.4 Add a non-Option element 31 1.4 Add a non-Option element
32 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEleme nt.. 32 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': Not a valid union member..
33 PASS select1.options.length is 3 33 PASS select1.options.length is 3
34 PASS select1.selectedIndex is 0 34 PASS select1.selectedIndex is 0
35 35
36 1.5 Add a non-element (string) 36 1.5 Add a non-element (string)
37 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEleme nt.. 37 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': Not a valid union member..
38 PASS select1.options.length is 3 38 PASS select1.options.length is 3
39 PASS select1.selectedIndex is 0 39 PASS select1.selectedIndex is 0
40 40
41 1.6 Add a non-element (number) 41 1.6 Add a non-element (number)
42 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEleme nt.. 42 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': Not a valid union member..
43 PASS select1.options.length is 3 43 PASS select1.options.length is 3
44 PASS select1.selectedIndex is 0 44 PASS select1.selectedIndex is 0
45 45
46 1.7 Add a non-element (boolean) 46 1.7 Add a non-element (boolean)
47 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEleme nt.. 47 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': Not a valid union member..
48 PASS select1.options.length is 3 48 PASS select1.options.length is 3
49 PASS select1.selectedIndex is 0 49 PASS select1.selectedIndex is 0
50 50
51 1.8 Add undefined 51 1.8 Add undefined
52 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEleme nt.. 52 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': Not a valid union member..
53 PASS select1.options.length is 3 53 PASS select1.options.length is 3
54 PASS select1.selectedIndex is 0 54 PASS select1.selectedIndex is 0
55 55
56 1.9 Add null 56 1.9 Add null
57 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEleme nt.. 57 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': Not a valid union member..
58 PASS select1.options.length is 3 58 PASS select1.options.length is 3
59 PASS select1.selectedIndex is 0 59 PASS select1.selectedIndex is 0
60 60
61 1.10 Add negative infinity 61 1.10 Add negative infinity
62 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEleme nt.. 62 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': Not a valid union member..
63 PASS select1.options.length is 3 63 PASS select1.options.length is 3
64 PASS select1.selectedIndex is 0 64 PASS select1.selectedIndex is 0
65 65
66 1.11 Add NaN 66 1.11 Add NaN
67 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEleme nt.. 67 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': Not a valid union member..
68 PASS select1.options.length is 3 68 PASS select1.options.length is 3
69 PASS select1.selectedIndex is 0 69 PASS select1.selectedIndex is 0
70 70
71 1.12 Add positive infinity 71 1.12 Add positive infinity
72 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEleme nt.. 72 PASS select1.options.add(option1) threw exception TypeError: Failed to execute ' add' on 'HTMLOptionsCollection': Not a valid union member..
73 PASS select1.options.length is 3 73 PASS select1.options.length is 3
74 PASS select1.selectedIndex is 0 74 PASS select1.selectedIndex is 0
75 75
76 2.1 Add Option to empty Options 76 2.1 Add Option to empty Options
77 PASS select2.options.length is 1 77 PASS select2.options.length is 1
78 PASS select2.selectedIndex is 0 78 PASS select2.selectedIndex is 0
79 PASS select2.options[0].value is '1' 79 PASS select2.options[0].value is '1'
80 PASS select2.options[0].textContent is 'A' 80 PASS select2.options[0].textContent is 'A'
81 81
82 2.2 Add Option after setting parameters 82 2.2 Add Option after setting parameters
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 PASS select2.options[3].value is '2' 151 PASS select2.options[3].value is '2'
152 PASS select2.options[3].textContent is 'B' 152 PASS select2.options[3].textContent is 'B'
153 PASS select2.options[4].value is '3' 153 PASS select2.options[4].value is '3'
154 PASS select2.options[4].textContent is 'C' 154 PASS select2.options[4].textContent is 'C'
155 PASS select2.options[5].value is '4' 155 PASS select2.options[5].value is '4'
156 PASS select2.options[5].textContent is 'D' 156 PASS select2.options[5].textContent is 'D'
157 PASS select2.options[6].value is '5' 157 PASS select2.options[6].value is '5'
158 PASS select2.options[6].textContent is 'E' 158 PASS select2.options[6].textContent is 'E'
159 159
160 2.8 Add an Option at index -2 160 2.8 Add an Option at index -2
161 PASS select2.options.add(option2, -2) threw exception IndexSizeError: Failed to execute 'add' on 'HTMLOptionsCollection': The index provided (-2) is less than - 1.. 161 PASS select2.options.add(option2, -2) did not throw exception.
162 PASS select2.options.length is 7 162 PASS select2.options.length is 8
163 PASS select2.selectedIndex is 1 163 PASS select2.selectedIndex is 1
164 164
165 2.9 Add an Option at index -Infinity 165 2.9 Add an Option at index -Infinity
166 PASS select2.options.add(option2, -1/0) did not throw exception. 166 PASS select2.options.add(option2, -1/0) did not throw exception.
167 PASS select2.options.length is 8 167 PASS select2.options.length is 9
168 PASS select2.selectedIndex is 2 168 PASS select2.selectedIndex is 2
169 169
170 2.10 Add an Option at index NaN 170 2.10 Add an Option at index NaN
171 PASS select2.options.add(option2, 0/0) did not throw exception. 171 PASS select2.options.add(option2, 0/0) did not throw exception.
172 PASS select2.options.length is 9 172 PASS select2.options.length is 10
173 PASS select2.selectedIndex is 3 173 PASS select2.selectedIndex is 3
174 174
175 2.11 Add an Option at index Infinity 175 2.11 Add an Option at index Infinity
176 PASS select2.options.add(option2, 1/0) did not throw exception. 176 PASS select2.options.add(option2, 1/0) did not throw exception.
177 PASS select2.options.length is 10 177 PASS select2.options.length is 11
178 PASS select2.selectedIndex is 4 178 PASS select2.selectedIndex is 4
179 179
180 2.12 Add a non-Option element 180 2.12 Add a non-Option element
181 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEl ement.. 181 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': Not a valid union member..
182 PASS select2.options.length is 10 182 PASS select2.options.length is 11
183 PASS select2.selectedIndex is 4 183 PASS select2.selectedIndex is 4
184 184
185 2.13 Add a non-element (string) 185 2.13 Add a non-element (string)
186 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEl ement.. 186 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': Not a valid union member..
187 PASS select2.options.length is 10 187 PASS select2.options.length is 11
188 PASS select2.selectedIndex is 4 188 PASS select2.selectedIndex is 4
189 189
190 2.14 Add a non-element (number) 190 2.14 Add a non-element (number)
191 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEl ement.. 191 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': Not a valid union member..
192 PASS select2.options.length is 10 192 PASS select2.options.length is 11
193 PASS select2.selectedIndex is 4 193 PASS select2.selectedIndex is 4
194 194
195 2.15 Add a non-element (boolean) 195 2.15 Add a non-element (boolean)
196 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEl ement.. 196 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': Not a valid union member..
197 PASS select2.options.length is 10 197 PASS select2.options.length is 11
198 PASS select2.selectedIndex is 4 198 PASS select2.selectedIndex is 4
199 199
200 2.16 Add undefined 200 2.16 Add undefined
201 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEl ement.. 201 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': Not a valid union member..
202 PASS select2.options.length is 10 202 PASS select2.options.length is 11
203 PASS select2.selectedIndex is 4 203 PASS select2.selectedIndex is 4
204 204
205 2.17 Add null 205 2.17 Add null
206 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEl ement.. 206 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': Not a valid union member..
207 PASS select2.options.length is 10 207 PASS select2.options.length is 11
208 PASS select2.selectedIndex is 4 208 PASS select2.selectedIndex is 4
209 209
210 2.18 Add negative infinity 210 2.18 Add negative infinity
211 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEl ement.. 211 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': Not a valid union member..
212 PASS select2.options.length is 10 212 PASS select2.options.length is 11
213 PASS select2.selectedIndex is 4 213 PASS select2.selectedIndex is 4
214 214
215 2.19 Add NaN 215 2.19 Add NaN
216 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEl ement.. 216 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': Not a valid union member..
217 PASS select2.options.length is 10 217 PASS select2.options.length is 11
218 PASS select2.selectedIndex is 4 218 PASS select2.selectedIndex is 4
219 219
220 2.20 Add positive infinity 220 2.20 Add positive infinity
221 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': The element provided was not an HTMLOptionEl ement.. 221 PASS select2.options.add(option2, 1) threw exception TypeError: Failed to execut e 'add' on 'HTMLOptionsCollection': Not a valid union member..
222 PASS select2.options.length is 10 222 PASS select2.options.length is 11
223 PASS select2.selectedIndex is 4 223 PASS select2.selectedIndex is 4
224 224
225 PASS successfullyParsed is true 225 PASS successfullyParsed is true
226 226
227 TEST COMPLETE 227 TEST COMPLETE
228 228
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698