| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 expect(() => new svg.SvgElement.svg(""), throwsStateError); | 63 expect(() => new svg.SvgElement.svg(""), throwsStateError); |
| 64 }); | 64 }); |
| 65 | 65 |
| 66 test('too many elements', () { | 66 test('too many elements', () { |
| 67 expect(() => new svg.SvgElement.svg("<circle></circle><path></path>"), | 67 expect(() => new svg.SvgElement.svg("<circle></circle><path></path>"), |
| 68 throwsStateError); | 68 throwsStateError); |
| 69 }); | 69 }); |
| 70 }); | 70 }); |
| 71 | 71 |
| 72 // Unfortunately, because the filtering mechanism in unitttest is a regex done | 72 // Unfortunately, because the filtering mechanism in unitttest is a regex done |
| 73 group('supported_altGlyph', () { | |
| 74 test('supported', () { | |
| 75 expect(svg.AltGlyphElement.supported, true); | |
| 76 }); | |
| 77 }); | |
| 78 | |
| 79 group('supported_animate', () { | 73 group('supported_animate', () { |
| 80 test('supported', () { | 74 test('supported', () { |
| 81 expect(svg.AnimateElement.supported, true); | 75 expect(svg.AnimateElement.supported, true); |
| 82 }); | 76 }); |
| 83 }); | 77 }); |
| 84 | 78 |
| 85 group('supported_animateMotion', () { | 79 group('supported_animateMotion', () { |
| 86 test('supported', () { | 80 test('supported', () { |
| 87 expect(svg.AnimateMotionElement.supported, true); | 81 expect(svg.AnimateMotionElement.supported, true); |
| 88 }); | 82 }); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 testConstructor('style', (e) => e is svg.StyleElement); | 264 testConstructor('style', (e) => e is svg.StyleElement); |
| 271 testConstructor('switch', (e) => e is svg.SwitchElement); | 265 testConstructor('switch', (e) => e is svg.SwitchElement); |
| 272 testConstructor('symbol', (e) => e is svg.SymbolElement); | 266 testConstructor('symbol', (e) => e is svg.SymbolElement); |
| 273 testConstructor('tspan', (e) => e is svg.TSpanElement); | 267 testConstructor('tspan', (e) => e is svg.TSpanElement); |
| 274 testConstructor('text', (e) => e is svg.TextElement); | 268 testConstructor('text', (e) => e is svg.TextElement); |
| 275 testConstructor('textPath', (e) => e is svg.TextPathElement); | 269 testConstructor('textPath', (e) => e is svg.TextPathElement); |
| 276 testConstructor('title', (e) => e is svg.TitleElement); | 270 testConstructor('title', (e) => e is svg.TitleElement); |
| 277 testConstructor('use', (e) => e is svg.UseElement); | 271 testConstructor('use', (e) => e is svg.UseElement); |
| 278 testConstructor('view', (e) => e is svg.ViewElement); | 272 testConstructor('view', (e) => e is svg.ViewElement); |
| 279 // TODO(alanknight): Issue 23144 | 273 // TODO(alanknight): Issue 23144 |
| 280 testConstructor('altGlyph', (e) => e is svg.AltGlyphElement, | |
| 281 svg.AltGlyphElement.supported, false); | |
| 282 testConstructor('animate', (e) => e is svg.AnimateElement, | 274 testConstructor('animate', (e) => e is svg.AnimateElement, |
| 283 svg.AnimateElement.supported); | 275 svg.AnimateElement.supported); |
| 284 testConstructor('animateMotion', (e) => e is svg.AnimateMotionElement, | 276 testConstructor('animateMotion', (e) => e is svg.AnimateMotionElement, |
| 285 svg.AnimateMotionElement.supported); | 277 svg.AnimateMotionElement.supported); |
| 286 testConstructor('animateTransform', (e) => e is svg.AnimateTransformElemen
t, | 278 testConstructor('animateTransform', (e) => e is svg.AnimateTransformElemen
t, |
| 287 svg.AnimateTransformElement.supported); | 279 svg.AnimateTransformElement.supported); |
| 288 testConstructor('feBlend', (e) => e is svg.FEBlendElement, | 280 testConstructor('feBlend', (e) => e is svg.FEBlendElement, |
| 289 svg.FEBlendElement.supported); | 281 svg.FEBlendElement.supported); |
| 290 testConstructor('feColorMatrix', (e) => e is svg.FEColorMatrixElement, | 282 testConstructor('feColorMatrix', (e) => e is svg.FEColorMatrixElement, |
| 291 svg.FEColorMatrixElement.supported); | 283 svg.FEColorMatrixElement.supported); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 group('PathElement', () { | 465 group('PathElement', () { |
| 474 test('pathSegList', () { | 466 test('pathSegList', () { |
| 475 svg.PathElement path = | 467 svg.PathElement path = |
| 476 new svg.SvgElement.svg('<path d="M 100 100 L 300 100 L 200 300 z"/>'); | 468 new svg.SvgElement.svg('<path d="M 100 100 L 300 100 L 200 300 z"/>'); |
| 477 for (var seg in path.pathSegList) { | 469 for (var seg in path.pathSegList) { |
| 478 expect(seg is svg.PathSeg, isTrue); | 470 expect(seg is svg.PathSeg, isTrue); |
| 479 } | 471 } |
| 480 }); | 472 }); |
| 481 }); | 473 }); |
| 482 } | 474 } |
| OLD | NEW |