| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library ElementTest; | 5 library ElementTest; |
| 6 | 6 |
| 7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
| 8 import 'package:unittest/html_individual_config.dart'; | 8 import 'package:unittest/html_individual_config.dart'; |
| 9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 import 'dart:html'; | 10 import 'dart:html'; |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 ['a capture', 'b capture', 'b no-capture', 'a no-capture']); | 927 ['a capture', 'b capture', 'b no-capture', 'a no-capture']); |
| 928 }); | 928 }); |
| 929 }); | 929 }); |
| 930 | 930 |
| 931 group('ElementList', () { | 931 group('ElementList', () { |
| 932 // Tests for methods on the DOM class 'NodeList'. | 932 // Tests for methods on the DOM class 'NodeList'. |
| 933 // | 933 // |
| 934 // There are two interesting things that are checked here from the viewpoint | 934 // There are two interesting things that are checked here from the viewpoint |
| 935 // of the dart2js implementation of a 'native' class: | 935 // of the dart2js implementation of a 'native' class: |
| 936 // | 936 // |
| 937 // 1. Some methods are implementated from by 'Object' or 'Interceptor'; | 937 // 1. Some methods are implemented from by 'Object' or 'Interceptor'; |
| 938 // some of these tests simply check that a method can be called. | 938 // some of these tests simply check that a method can be called. |
| 939 // 2. Some methods are implemented by mixins. | 939 // 2. Some methods are implemented by mixins. |
| 940 | 940 |
| 941 ElementList<Element> makeElementList() => | 941 ElementList<Element> makeElementList() => |
| 942 (new Element.html("<div>Foo<br/><!--baz--><br/><br/></div>")) | 942 (new Element.html("<div>Foo<br/><!--baz--><br/><br/></div>")) |
| 943 .queryAll('br'); | 943 .queryAll('br'); |
| 944 | 944 |
| 945 test('hashCode', () { | 945 test('hashCode', () { |
| 946 var nodes = makeElementList(); | 946 var nodes = makeElementList(); |
| 947 var hash = nodes.hashCode; | 947 var hash = nodes.hashCode; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 991 }); | 991 }); |
| 992 | 992 |
| 993 test('sublist', () { | 993 test('sublist', () { |
| 994 var range = makeElementList().sublist(1, 3); | 994 var range = makeElementList().sublist(1, 3); |
| 995 expect(range.length, 2); | 995 expect(range.length, 2); |
| 996 expect(range[0], isBRElement); | 996 expect(range[0], isBRElement); |
| 997 expect(range[1], isBRElement); | 997 expect(range[1], isBRElement); |
| 998 }); | 998 }); |
| 999 }); | 999 }); |
| 1000 } | 1000 } |
| OLD | NEW |