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 #import('../../pkg/unittest/unittest.dart'); | 6 #import('../../pkg/unittest/unittest.dart'); |
7 #import('../../pkg/unittest/html_config.dart'); | 7 #import('../../pkg/unittest/html_config.dart'); |
8 #import('dart:html'); | 8 #import('dart:html'); |
9 | 9 |
10 expectLargeRect(ClientRect rect) { | 10 expectLargeRect(ClientRect rect) { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 Expect.equals(rect.bounding.left, 8); | 78 Expect.equals(rect.bounding.left, 8); |
79 Expect.equals(rect.bounding.top, 8); | 79 Expect.equals(rect.bounding.top, 8); |
80 Expect.isTrue(rect.clientRects.length > 0); | 80 Expect.isTrue(rect.clientRects.length > 0); |
81 container.remove(); | 81 container.remove(); |
82 })); | 82 })); |
83 }); | 83 }); |
84 | 84 |
85 group('constructors', () { | 85 group('constructors', () { |
86 test('error', () { | 86 test('error', () { |
87 Expect.throws(() => new Element.html('<br/><br/>'), | 87 Expect.throws(() => new Element.html('<br/><br/>'), |
88 (e) => e is IllegalArgumentException); | 88 (e) => e is ArgumentError); |
89 }); | 89 }); |
90 | 90 |
91 test('.html has no parent', () => | 91 test('.html has no parent', () => |
92 Expect.isNull(new Element.html('<br/>').parent)); | 92 Expect.isNull(new Element.html('<br/>').parent)); |
93 | 93 |
94 test('a', () => testConstructorHelper('a', '<a>foo</a>', 'foo', | 94 test('a', () => testConstructorHelper('a', '<a>foo</a>', 'foo', |
95 (element) => element is AnchorElement)); | 95 (element) => element is AnchorElement)); |
96 test('area', () => testConstructorHelper('area', '<area>foo</area>', '', | 96 test('area', () => testConstructorHelper('area', '<area>foo</area>', '', |
97 (element) => element is AreaElement)); | 97 (element) => element is AreaElement)); |
98 // TODO(jacobr): audio tags cause tests to segfault when using dartium. | 98 // TODO(jacobr): audio tags cause tests to segfault when using dartium. |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 }); | 743 }); |
744 | 744 |
745 test('getRange', () { | 745 test('getRange', () { |
746 var range = makeElList().getRange(1, 2); | 746 var range = makeElList().getRange(1, 2); |
747 Expect.isTrue(range is ElementList); | 747 Expect.isTrue(range is ElementList); |
748 Expect.isTrue(range[0] is ImageElement); | 748 Expect.isTrue(range[0] is ImageElement); |
749 Expect.isTrue(range[1] is InputElement); | 749 Expect.isTrue(range[1] is InputElement); |
750 }); | 750 }); |
751 }); | 751 }); |
752 } | 752 } |
OLD | NEW |