| OLD | NEW |
| 1 library SVG3Test; | 1 library SVG3Test; |
| 2 import '../../pkg/unittest/lib/unittest.dart'; | 2 import '../../pkg/unittest/lib/unittest.dart'; |
| 3 import '../../pkg/unittest/lib/html_config.dart'; | 3 import '../../pkg/unittest/lib/html_config.dart'; |
| 4 import 'dart:html'; | 4 import 'dart:html'; |
| 5 import 'dart:svg' as svg; | 5 import 'dart:svg' as svg; |
| 6 | 6 |
| 7 // Test that SVG elements have the operations advertised through all the IDL | 7 // Test that SVG elements have the operations advertised through all the IDL |
| 8 // interfaces. This is a 'duck typing' test, and does not explicitly use 'is' | 8 // interfaces. This is a 'duck typing' test, and does not explicitly use 'is' |
| 9 // checks on the expected interfaces (that is in SVGTest2). | 9 // checks on the expected interfaces (that is in SVGTest2). |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 * svg.ExternalResourcesRequired interface. | 74 * svg.ExternalResourcesRequired interface. |
| 75 */ | 75 */ |
| 76 checkSvgExternalResourcesRequired(e) { | 76 checkSvgExternalResourcesRequired(e) { |
| 77 var b = e.externalResourcesRequired; | 77 var b = e.externalResourcesRequired; |
| 78 expect(b, isSvgAnimatedBoolean); | 78 expect(b, isSvgAnimatedBoolean); |
| 79 expect(b.baseVal, isFalse); | 79 expect(b.baseVal, isFalse); |
| 80 expect(b.animVal, isFalse); | 80 expect(b.animVal, isFalse); |
| 81 } | 81 } |
| 82 | 82 |
| 83 /** | 83 /** |
| 84 * Verifies that [e] supports the operations on the svg.Stylable interface. | |
| 85 */ | |
| 86 checkSvgStylable(e) { | |
| 87 var className = e.$dom_svgClassName; | |
| 88 expect(className, isSvgAnimatedString); | |
| 89 | |
| 90 var s = e.style; | |
| 91 expect(s, isCssStyleDeclaration); | |
| 92 | |
| 93 var attributeA = e.getPresentationAttribute('A'); | |
| 94 expect(attributeA, anyOf(isNull, isCssValue)); | |
| 95 } | |
| 96 | |
| 97 /** | |
| 98 * Verifies that [e] supports the operations on the svg.Locatable interface. | 84 * Verifies that [e] supports the operations on the svg.Locatable interface. |
| 99 */ | 85 */ |
| 100 checkSvgLocatable(e) { | 86 checkSvgLocatable(e) { |
| 101 var v1 = e.farthestViewportElement; | 87 var v1 = e.farthestViewportElement; |
| 102 var v2 = e.nearestViewportElement; | 88 var v2 = e.nearestViewportElement; |
| 103 expect(v1, same(v2)); | 89 expect(v1, same(v2)); |
| 104 | 90 |
| 105 var bbox = e.getBBox(); | 91 var bbox = e.getBBox(); |
| 106 expect(bbox, isSvgRect); | 92 expect(bbox, isSvgRect); |
| 107 | 93 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 130 var r = document.query('#rect1'); | 116 var r = document.query('#rect1'); |
| 131 checker(r); | 117 checker(r); |
| 132 div.remove(); | 118 div.remove(); |
| 133 }); | 119 }); |
| 134 } | 120 } |
| 135 | 121 |
| 136 testRect('rect_SvgTests', checkSvgTests); | 122 testRect('rect_SvgTests', checkSvgTests); |
| 137 testRect('rect_SvgLangSpace', checkSvgLangSpace); | 123 testRect('rect_SvgLangSpace', checkSvgLangSpace); |
| 138 testRect('rect_SvgExternalResourcesRequired', | 124 testRect('rect_SvgExternalResourcesRequired', |
| 139 checkSvgExternalResourcesRequired); | 125 checkSvgExternalResourcesRequired); |
| 140 testRect('rect_SvgStylable', checkSvgStylable); | |
| 141 testRect('rect_SvgLocatable', checkSvgLocatable); | 126 testRect('rect_SvgLocatable', checkSvgLocatable); |
| 142 testRect('rect_SvgTransformable', checkSvgTransformable); | 127 testRect('rect_SvgTransformable', checkSvgTransformable); |
| 143 | 128 |
| 144 } | 129 } |
| OLD | NEW |