blob: e4a7712131b1de9504007dfded6d0c32ad37a678 [file] [log] [blame]
This test checks the SVGTransform API
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Check initial transform values
PASS transform.type is SVGTransform.SVG_TRANSFORM_MATRIX
PASS transform.angle is 0
PASS transform.matrix.a is 1
PASS transform.matrix.b is 0
PASS transform.matrix.c is 0
PASS transform.matrix.d is 1
PASS transform.matrix.e is 0
PASS transform.matrix.f is 0
Change to skewX transformation
PASS transform.setSkewX(45) is undefined.
PASS transform.type is SVGTransform.SVG_TRANSFORM_SKEWX
PASS transform.angle is 45
PASS transform.matrix.a is 1
PASS transform.matrix.b is 0
PASS transform.matrix.c.toFixed(1) is "1.0"
PASS transform.matrix.d is 1
PASS transform.matrix.e is 0
PASS transform.matrix.f is 0
Changing matrix.e to 100, should reset transformation type to MATRIX, and angle should be 0
PASS transform.matrix.e = 100 is 100
PASS transform.type is SVGTransform.SVG_TRANSFORM_MATRIX
PASS transform.angle is 0
PASS transform.matrix.a is 1
PASS transform.matrix.b is 0
PASS transform.matrix.c.toFixed(1) is "1.0"
PASS transform.matrix.d is 1
PASS transform.matrix.e is 100
PASS transform.matrix.f is 0
Now revert to initial matrix
PASS transform.matrix.c = null is null
PASS transform.matrix.e = 0 is 0
PASS transform.type is SVGTransform.SVG_TRANSFORM_MATRIX
PASS transform.angle is 0
PASS transform.matrix.a is 1
PASS transform.matrix.b is 0
PASS transform.matrix.c is 0
PASS transform.matrix.d is 1
PASS transform.matrix.e is 0
PASS transform.matrix.f is 0
Check passing invalid arguments to 'setMatrix'
PASS transform.setMatrix() threw exception TypeError: Not enough arguments.
PASS transform.setMatrix(transform) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
PASS transform.setMatrix(svgElement) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
PASS transform.setMatrix('aString') threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
PASS transform.setMatrix(1) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
PASS transform.setMatrix(false) threw exception TypeError: Argument 1 ('matrix') to SVGTransform.setMatrix must be an instance of SVGMatrix.
Check passing invalid arguments to 'setTranslate'
PASS transform.setTranslate() threw exception TypeError: Not enough arguments.
PASS transform.setTranslate(transform) threw exception TypeError: Not enough arguments.
PASS transform.setTranslate(svgElement) threw exception TypeError: Not enough arguments.
PASS transform.setTranslate('aString') threw exception TypeError: Not enough arguments.
PASS transform.setTranslate(1, transform) is undefined.
PASS transform.setTranslate(1, svgElement) is undefined.
PASS transform.setTranslate(1, 'aString') is undefined.
PASS transform.setTranslate(transform, 1) is undefined.
PASS transform.setTranslate(svgElement, 1) is undefined.
PASS transform.setTranslate('aString', 1) is undefined.
PASS transform.setTranslate(transform, transform) is undefined.
PASS transform.setTranslate(svgElement, svgElement) is undefined.
PASS transform.setTranslate('aString', 'aString') is undefined.
Check passing invalid arguments to 'setScale'
PASS transform.setScale() threw exception TypeError: Not enough arguments.
PASS transform.setScale(transform) threw exception TypeError: Not enough arguments.
PASS transform.setScale(svgElement) threw exception TypeError: Not enough arguments.
PASS transform.setScale('aString') threw exception TypeError: Not enough arguments.
PASS transform.setScale(1, transform) is undefined.
PASS transform.setScale(1, svgElement) is undefined.
PASS transform.setScale(1, 'aString') is undefined.
PASS transform.setScale(transform, 1) is undefined.
PASS transform.setScale(svgElement, 1) is undefined.
PASS transform.setScale('aString', 1) is undefined.
PASS transform.setScale(transform, transform) is undefined.
PASS transform.setScale(svgElement, svgElement) is undefined.
PASS transform.setScale('aString', 'aString') is undefined.
Check passing invalid arguments to 'setRotate'
PASS transform.setRotate() threw exception TypeError: Not enough arguments.
PASS transform.setRotate(transform) threw exception TypeError: Not enough arguments.
PASS transform.setRotate(svgElement) threw exception TypeError: Not enough arguments.
PASS transform.setRotate('aString') threw exception TypeError: Not enough arguments.
PASS transform.setRotate(1, transform) threw exception TypeError: Not enough arguments.
PASS transform.setRotate(1, svgElement) threw exception TypeError: Not enough arguments.
PASS transform.setRotate(1, 'aString') threw exception TypeError: Not enough arguments.
PASS transform.setRotate(1, 1, transform) is undefined.
PASS transform.setRotate(1, 1, svgElement) is undefined.
PASS transform.setRotate(1, 1, 'aString') is undefined.
Check passing invalid arguments to 'setSkewX'
PASS transform.setSkewX() threw exception TypeError: Not enough arguments.
PASS transform.setSkewX(transform) is undefined.
PASS transform.setSkewX(svgElement) is undefined.
PASS transform.setSkewX('aString') is undefined.
Check passing invalid arguments to 'setSkewY'
PASS transform.setSkewY() threw exception TypeError: Not enough arguments.
PASS transform.setSkewY(transform) is undefined.
PASS transform.setSkewY(svgElement) is undefined.
PASS transform.setSkewY('aString') is undefined.
PASS successfullyParsed is true
TEST COMPLETE