Index: tests/html/svg_3_test.dart |
=================================================================== |
--- tests/html/svg_3_test.dart (revision 14114) |
+++ tests/html/svg_3_test.dart (working copy) |
@@ -9,6 +9,20 @@ |
main() { |
+ var isString = new isInstanceOf<String>('String'); |
+ var isStringList = new isInstanceOf<List<String>>('List<String>'); |
+ var isSVGMatrix = new isInstanceOf<SVGMatrix>('SVGMatrix'); |
+ var isSVGAnimatedBoolean = new |
+ isInstanceOf<SVGAnimatedBoolean>('SVGAnimatedBoolean'); |
+ var isSVGAnimatedString = new |
+ isInstanceOf<SVGAnimatedString>('SVGAnimatedString'); |
+ var isSVGRect = new isInstanceOf<SVGRect>('SVGRect'); |
+ var isSVGAnimatedTransformList = new |
+ isInstanceOf<SVGAnimatedTransformList>('SVGAnimatedTransformList'); |
+ var isCSSStyleDeclaration = new |
+ isInstanceOf<CSSStyleDeclaration>('CSSStyleDeclaration'); |
+ var isCSSValue = new isInstanceOf<CSSValue>('CSSValue'); |
+ |
insertTestDiv() { |
var element = new Element.tag('div'); |
element.innerHTML = r''' |
@@ -28,14 +42,14 @@ |
checkSVGTests(e) { |
// Just check that the operations seem to exist. |
var rx = e.requiredExtensions; |
- Expect.isTrue(rx is List<String>); |
+ expect(rx, isStringList); |
var rf = e.requiredFeatures; |
- Expect.isTrue(rf is List<String>); |
+ expect(rf, isStringList); |
var sl = e.systemLanguage; |
- Expect.isTrue(sl is List<String>); |
+ expect(sl, isStringList); |
bool hasDoDo = e.hasExtension("DoDo"); |
- Expect.isFalse(hasDoDo); |
+ expect(hasDoDo, isFalse); |
} |
/** |
@@ -49,8 +63,8 @@ |
String space = e.xmlspace; |
e.xmlspace = space; |
- Expect.isTrue(lang is String); |
- Expect.isTrue(space is String); |
+ expect(lang, isString); |
+ expect(space, isString); |
} |
/** |
@@ -59,9 +73,9 @@ |
*/ |
checkSVGExternalResourcesRequired(e) { |
var b = e.externalResourcesRequired; |
- Expect.isTrue(b is SVGAnimatedBoolean); |
- Expect.isFalse(b.baseVal); |
- Expect.isFalse(b.animVal); |
+ expect(b, isSVGAnimatedBoolean); |
+ expect(b.baseVal, isFalse); |
+ expect(b.animVal, isFalse); |
} |
/** |
@@ -69,13 +83,13 @@ |
*/ |
checkSVGStylable(e) { |
var className = e.$dom_svgClassName; |
- Expect.isTrue(className is SVGAnimatedString); |
+ expect(className, isSVGAnimatedString); |
var s = e.style; |
- Expect.isTrue(s is CSSStyleDeclaration); |
+ expect(s, isCSSStyleDeclaration); |
var attributeA = e.getPresentationAttribute('A'); |
- Expect.isTrue(attributeA === null || attributeA is CSSValue); |
+ expect(attributeA, anyOf(isNull, isCSSValue)); |
} |
/** |
@@ -84,19 +98,19 @@ |
checkSVGLocatable(e) { |
var v1 = e.farthestViewportElement; |
var v2 = e.nearestViewportElement; |
- Expect.isTrue(v1 === v2); |
+ expect(v1, same(v2)); |
var bbox = e.getBBox(); |
- Expect.isTrue(bbox is SVGRect); |
+ expect(bbox, isSVGRect); |
var ctm = e.getCTM(); |
- Expect.isTrue(ctm is SVGMatrix); |
+ expect(ctm, isSVGMatrix); |
var sctm = e.getScreenCTM(); |
- Expect.isTrue(sctm is SVGMatrix); |
+ expect(sctm, isSVGMatrix); |
var xf2e = e.getTransformToElement(e); |
- Expect.isTrue(xf2e is SVGMatrix); |
+ expect(xf2e, isSVGMatrix); |
} |
/** |
@@ -105,7 +119,7 @@ |
*/ |
checkSVGTransformable(e) { |
var trans = e.transform; |
- Expect.isTrue(trans is SVGAnimatedTransformList); |
+ expect(trans, isSVGAnimatedTransformList); |
} |
testRect(name, checker) { |