blob: 1cd78aa7befc19bf0414f511505c245ec44ea264 [file] [log] [blame]
This test checks the SVGPoint API
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Check initial point values
PASS point.x is 0
PASS point.y is 0
Check assigning points
PASS point.x = 100 is 100
PASS point.y = 200 is 200
Check assigning invalid points
PASS point.x = point is point
PASS point.y = null is null
Check that the point contains the correct values
PASS point.x is NaN
PASS point.y is 0
Reset to -50, 100
Check 'matrixTransform' method - multiply with -1,0,0,2,10,10 matrix, should flip x coordinate, multiply y by two and translate each coordinate by 10
PASS (newPoint = point.matrixTransform(ctm)).toString() is "[object SVGPoint]"
PASS newPoint.x is 60
PASS newPoint.y is 210
Check invalid arguments for 'matrixTransform'
PASS point.matrixTransform() threw exception TypeError: Not enough arguments.
PASS point.matrixTransform(-1) threw exception TypeError: Argument 1 ('matrix') to SVGPoint.matrixTransform must be an instance of SVGMatrix.
PASS point.matrixTransform(5) threw exception TypeError: Argument 1 ('matrix') to SVGPoint.matrixTransform must be an instance of SVGMatrix.
PASS point.matrixTransform('aString') threw exception TypeError: Argument 1 ('matrix') to SVGPoint.matrixTransform must be an instance of SVGMatrix.
PASS point.matrixTransform(point) threw exception TypeError: Argument 1 ('matrix') to SVGPoint.matrixTransform must be an instance of SVGMatrix.
PASS point.matrixTransform(svgElement) threw exception TypeError: Argument 1 ('matrix') to SVGPoint.matrixTransform must be an instance of SVGMatrix.
PASS successfullyParsed is true
TEST COMPLETE