| 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('aString') threw exception TypeError: Type error. |
| PASS transform.setMatrix(1) threw exception TypeError: Type error. |
| PASS transform.setMatrix(false) threw exception TypeError: Type error. |
| Check passing abritary objects, nothing or dictionaries |
| PASS transform.setMatrix(transform) is undefined. |
| PASS transform.setMatrix(svgElement) is undefined. |
| PASS transform.setMatrix({a: 2, b: 0, c: 0, d: 2, e: 10, f: 10}) is undefined. |
| PASS transform.matrix.a is 2 |
| PASS transform.matrix.b is 0 |
| PASS transform.matrix.c is 0 |
| PASS transform.matrix.d is 2 |
| PASS transform.matrix.e is 10 |
| PASS transform.matrix.f is 10 |
| PASS transform.setMatrix() is undefined. |
| 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 '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 |
| |