| 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('../../lib/unittest/unittest.dart'); | 6 #import('../../lib/unittest/unittest.dart'); |
| 7 #import('../../lib/unittest/html_config.dart'); | 7 #import('../../lib/unittest/html_config.dart'); |
| 8 #import('dart:html'); | 8 #import('dart:html'); |
| 9 | 9 |
| 10 expectLargeRect(ClientRect rect) { | 10 expectLargeRect(ClientRect rect) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 if (registerOnEventListener != null) { | 35 if (registerOnEventListener != null) { |
| 36 Expect.isTrue(firedOnEvent); | 36 Expect.isTrue(firedOnEvent); |
| 37 } | 37 } |
| 38 } | 38 } |
| 39 | 39 |
| 40 void testConstructorHelper(String tag, String htmlSnippet, | 40 void testConstructorHelper(String tag, String htmlSnippet, |
| 41 String expectedText, Function isExpectedClass) { | 41 String expectedText, Function isExpectedClass) { |
| 42 Expect.isTrue(isExpectedClass(new Element.tag(tag))); | 42 Expect.isTrue(isExpectedClass(new Element.tag(tag))); |
| 43 final elementFromSnippet = new Element.html(htmlSnippet); | 43 final elementFromSnippet = new Element.html(htmlSnippet); |
| 44 Expect.isTrue(isExpectedClass(elementFromSnippet)); | 44 Expect.isTrue(isExpectedClass(elementFromSnippet)); |
| 45 Expect.equals(elementFromSnippet.text, expectedText); | 45 Expect.equals(expectedText, elementFromSnippet.text); |
| 46 } | 46 } |
| 47 | 47 |
| 48 main() { | 48 main() { |
| 49 useHtmlConfiguration(); | 49 useHtmlConfiguration(); |
| 50 | 50 |
| 51 Element makeElement() => new Element.tag('div'); | 51 Element makeElement() => new Element.tag('div'); |
| 52 | 52 |
| 53 Element makeElementWithChildren() => | 53 Element makeElementWithChildren() => |
| 54 new Element.html("<div><br/><img/><input/></div>"); | 54 new Element.html("<div><br/><img/><input/></div>"); |
| 55 | 55 |
| (...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 classes.intersection(['foo', 'qux', 'baz'])); | 888 classes.intersection(['foo', 'qux', 'baz'])); |
| 889 }); | 889 }); |
| 890 | 890 |
| 891 test('clear', () { | 891 test('clear', () { |
| 892 final classes = makeClassSet(); | 892 final classes = makeClassSet(); |
| 893 classes.clear(); | 893 classes.clear(); |
| 894 Expect.setEquals([], classes); | 894 Expect.setEquals([], classes); |
| 895 }); | 895 }); |
| 896 }); | 896 }); |
| 897 } | 897 } |
| OLD | NEW |