OLD | NEW |
1 #library('ElementListTest'); | 1 #library('ElementListTest'); |
2 #import('../../pkg/unittest/unittest.dart'); | 2 #import('../../pkg/unittest/unittest.dart'); |
3 #import('../../pkg/unittest/html_config.dart'); | 3 #import('../../pkg/unittest/html_config.dart'); |
4 #import('dart:html'); | 4 #import('dart:html'); |
5 | 5 |
6 // Test that List<Element> implements List<T> | 6 // Test that List<Element> implements List<T> |
7 main() { | 7 main() { |
8 Element insertTestDiv() { | 8 Element insertTestDiv() { |
9 Element element = new Element.tag('div'); | 9 Element element = new Element.tag('div'); |
10 element.innerHTML = r""" | 10 element.innerHTML = r""" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 root.remove(); | 204 root.remove(); |
205 }); | 205 }); |
206 test('Last', () { | 206 test('Last', () { |
207 Element root = insertTestDiv(); | 207 Element root = insertTestDiv(); |
208 | 208 |
209 List<Element> someChecked = | 209 List<Element> someChecked = |
210 document.query('#someChecked').elements; | 210 document.query('#someChecked').elements; |
211 | 211 |
212 Expect.equals(4, someChecked.length); | 212 Expect.equals(4, someChecked.length); |
213 | 213 |
214 Expect.equals(someChecked[3], someChecked.last()); | 214 Expect.equals(someChecked[3], someChecked.last); |
215 | 215 |
216 root.remove(); | 216 root.remove(); |
217 }); | 217 }); |
218 test('IndexOf', () { | 218 test('IndexOf', () { |
219 Element root = insertTestDiv(); | 219 Element root = insertTestDiv(); |
220 | 220 |
221 List<Element> someChecked = | 221 List<Element> someChecked = |
222 document.query('#someChecked').elements; | 222 document.query('#someChecked').elements; |
223 | 223 |
224 List<Element> noneChecked = | 224 List<Element> noneChecked = |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 Expect.equals(-1, someChecked.lastIndexOf(someChecked[3], 2)); | 268 Expect.equals(-1, someChecked.lastIndexOf(someChecked[3], 2)); |
269 | 269 |
270 Expect.equals(-1, someChecked.lastIndexOf(noneChecked[0], 3)); | 270 Expect.equals(-1, someChecked.lastIndexOf(noneChecked[0], 3)); |
271 Expect.equals(-1, noneChecked.lastIndexOf(someChecked[0], 3)); | 271 Expect.equals(-1, noneChecked.lastIndexOf(someChecked[0], 3)); |
272 Expect.equals(-1, someChecked.lastIndexOf(noneChecked[1], 3)); | 272 Expect.equals(-1, someChecked.lastIndexOf(noneChecked[1], 3)); |
273 Expect.equals(-1, noneChecked.lastIndexOf(someChecked[1], 3)); | 273 Expect.equals(-1, noneChecked.lastIndexOf(someChecked[1], 3)); |
274 | 274 |
275 root.remove(); | 275 root.remove(); |
276 }); | 276 }); |
277 } | 277 } |
OLD | NEW |