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 'dart:html'; | 6 import 'dart:html'; |
7 import 'dart:svg' as svg; | 7 import 'dart:svg' as svg; |
8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
9 import 'package:unittest/html_individual_config.dart'; | 9 import 'package:unittest/html_individual_config.dart'; |
10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 <circle></circle> | 45 <circle></circle> |
46 <path></path> | 46 <path></path> |
47 </svg>"""; | 47 </svg>"""; |
48 final el = new svg.SvgElement.svg(svgContent); | 48 final el = new svg.SvgElement.svg(svgContent); |
49 expect(el, isSvgSvgElement); | 49 expect(el, isSvgSvgElement); |
50 expect(el.innerHtml, anyOf("<circle></circle><path></path>", '<circle ' | 50 expect(el.innerHtml, anyOf("<circle></circle><path></path>", '<circle ' |
51 'xmlns="http://www.w3.org/2000/svg" /><path ' | 51 'xmlns="http://www.w3.org/2000/svg" /><path ' |
52 'xmlns="http://www.w3.org/2000/svg" />')); | 52 'xmlns="http://www.w3.org/2000/svg" />')); |
53 expect(el.outerHtml, anyOf(svgContent, | 53 expect(el.outerHtml, anyOf(svgContent, |
54 '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">\n ' | 54 '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">\n ' |
55 '<circle />\n <path />\n</svg>')); | 55 '<circle />\n <path />\n</svg>', |
| 56 '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">\r\n ' |
| 57 '<circle />\r\n <path />\r\n</svg>')); |
56 }); | 58 }); |
57 | 59 |
58 test('has no parent', () => | 60 test('has no parent', () => |
59 expect(new svg.SvgElement.svg('<circle/>').parent, isNull) | 61 expect(new svg.SvgElement.svg('<circle/>').parent, isNull) |
60 ); | 62 ); |
61 | 63 |
62 test('empty', () { | 64 test('empty', () { |
63 expect(() => new svg.SvgElement.svg(""), throwsStateError); | 65 expect(() => new svg.SvgElement.svg(""), throwsStateError); |
64 }); | 66 }); |
65 | 67 |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 group('PathElement', () { | 475 group('PathElement', () { |
474 test('pathSegList', () { | 476 test('pathSegList', () { |
475 svg.PathElement path = | 477 svg.PathElement path = |
476 new svg.SvgElement.svg('<path d="M 100 100 L 300 100 L 200 300 z"/>'); | 478 new svg.SvgElement.svg('<path d="M 100 100 L 300 100 L 200 300 z"/>'); |
477 for (var seg in path.pathSegList) { | 479 for (var seg in path.pathSegList) { |
478 expect(seg is svg.PathSeg, isTrue); | 480 expect(seg is svg.PathSeg, isTrue); |
479 } | 481 } |
480 }); | 482 }); |
481 }); | 483 }); |
482 } | 484 } |
OLD | NEW |