| 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('SVGElementTest'); | 5 #library('SVGElementTest'); |
| 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 main() { | 10 main() { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 Expect.isTrue(el is SVGSVGElement); | 43 Expect.isTrue(el is SVGSVGElement); |
| 44 Expect.equals("<circle></circle><path></path>", el.innerHTML); | 44 Expect.equals("<circle></circle><path></path>", el.innerHTML); |
| 45 Expect.equals(svg, el.outerHTML); | 45 Expect.equals(svg, el.outerHTML); |
| 46 }); | 46 }); |
| 47 | 47 |
| 48 test('has no parent', () => | 48 test('has no parent', () => |
| 49 Expect.isNull(new SVGElement.svg('<circle/>').parent)); | 49 Expect.isNull(new SVGElement.svg('<circle/>').parent)); |
| 50 | 50 |
| 51 test('empty', () { | 51 test('empty', () { |
| 52 Expect.throws(() => new SVGElement.svg(""), | 52 Expect.throws(() => new SVGElement.svg(""), |
| 53 (e) => e is IllegalArgumentException); | 53 (e) => e is ArgumentError); |
| 54 }); | 54 }); |
| 55 | 55 |
| 56 test('too many elements', () { | 56 test('too many elements', () { |
| 57 Expect.throws( | 57 Expect.throws( |
| 58 () => new SVGElement.svg("<circle></circle><path></path>"), | 58 () => new SVGElement.svg("<circle></circle><path></path>"), |
| 59 (e) => e is IllegalArgumentException); | 59 (e) => e is ArgumentError); |
| 60 }); | 60 }); |
| 61 }); | 61 }); |
| 62 | 62 |
| 63 testConstructor('a', (e) => e is SVGAElement); | 63 testConstructor('a', (e) => e is SVGAElement); |
| 64 testConstructor('altGlyphDef', (e) => e is SVGAltGlyphDefElement); | 64 testConstructor('altGlyphDef', (e) => e is SVGAltGlyphDefElement); |
| 65 testConstructor('altGlyph', (e) => e is SVGAltGlyphElement); | 65 testConstructor('altGlyph', (e) => e is SVGAltGlyphElement); |
| 66 testConstructor('animateColor', (e) => e is SVGAnimateColorElement); | 66 testConstructor('animateColor', (e) => e is SVGAnimateColorElement); |
| 67 testConstructor('animate', (e) => e is SVGAnimateElement); | 67 testConstructor('animate', (e) => e is SVGAnimateElement); |
| 68 // WebKit doesn't recognize animateMotion | 68 // WebKit doesn't recognize animateMotion |
| 69 // testConstructor('animateMotion', (e) => e is SVGAnimateMotionElement); | 69 // testConstructor('animateMotion', (e) => e is SVGAnimateMotionElement); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 Expect.listEquals(["circle", "path"], _nodeStrings(el.elements)); | 181 Expect.listEquals(["circle", "path"], _nodeStrings(el.elements)); |
| 182 }); | 182 }); |
| 183 | 183 |
| 184 test('set', () { | 184 test('set', () { |
| 185 final el = new SVGSVGElement(); | 185 final el = new SVGSVGElement(); |
| 186 el.elements = [new SVGElement.tag("circle"), new SVGElement.tag("path")]; | 186 el.elements = [new SVGElement.tag("circle"), new SVGElement.tag("path")]; |
| 187 Expect.equals('<circle></circle><path></path>', el.innerHTML); | 187 Expect.equals('<circle></circle><path></path>', el.innerHTML); |
| 188 }); | 188 }); |
| 189 }); | 189 }); |
| 190 } | 190 } |
| OLD | NEW |