Test the behavior of currentPath in Canvas On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". Create path object, replace current context path with the path of this object. PASS ctx.isPointInPath(49,49) is false PASS ctx.isPointInPath(99,99) is false PASS ctx.isPointInPath(149,149) is false PASS ctx.isPointInPath(199,199) is false PASS ctx.isPointInPath(249,249) is false PASS ctx.isPointInPath(49,49) is true PASS ctx.isPointInPath(99,99) is true PASS ctx.isPointInPath(149,149) is true PASS ctx.isPointInPath(199,199) is true PASS ctx.isPointInPath(249,249) is false Add new segment to context path and check that this is not added to the path object (not live). PASS ctx.isPointInPath(49,49) is true PASS ctx.isPointInPath(99,99) is true PASS ctx.isPointInPath(149,149) is true PASS ctx.isPointInPath(199,199) is true PASS ctx.isPointInPath(249,249) is true PASS ctx.isPointInPath(49,49) is true PASS ctx.isPointInPath(99,99) is true PASS ctx.isPointInPath(149,149) is true PASS ctx.isPointInPath(199,199) is true PASS ctx.isPointInPath(249,249) is false Test that path object can get applied to transformed context, respecting the CTM. PASS ctx.isPointInPath(49,49) is false PASS ctx.isPointInPath(99,99) is false PASS ctx.isPointInPath(149,149) is true PASS ctx.isPointInPath(199,199) is true PASS ctx.isPointInPath(249,249) is true Test that currentPath returns a path object. PASS p is null PASS p is an instance of Path Create context path and test that it exists. PASS ctx.isPointInPath(49,49) is true PASS ctx.isPointInPath(99,99) is true PASS ctx.isPointInPath(149,149) is true PASS ctx.isPointInPath(199,199) is true PASS ctx.isPointInPath(249,249) is false Clear context path. PASS ctx.isPointInPath(49,49) is false PASS ctx.isPointInPath(99,99) is false PASS ctx.isPointInPath(149,149) is false PASS ctx.isPointInPath(199,199) is false PASS ctx.isPointInPath(249,249) is false Apply stored (non-live) path object back to context. PASS ctx.isPointInPath(49,49) is true PASS ctx.isPointInPath(99,99) is true PASS ctx.isPointInPath(149,149) is true PASS ctx.isPointInPath(199,199) is true PASS ctx.isPointInPath(249,249) is false Transform CTM in the process of adding segments to context path. Check that currentPath's path object archive these transformations. PASS ctx.isPointInPath(49,49) is true PASS ctx.isPointInPath(99,99) is true PASS ctx.isPointInPath(149,149) is false PASS ctx.isPointInPath(199,199) is true PASS ctx.isPointInPath(249,249) is true Clear current path on object and check that it is cleaned up. PASS ctx.isPointInPath(49,49) is false PASS ctx.isPointInPath(99,99) is false PASS ctx.isPointInPath(149,149) is false PASS ctx.isPointInPath(199,199) is false PASS ctx.isPointInPath(249,249) is false Apply path back to context path. PASS ctx.isPointInPath(49,49) is true PASS ctx.isPointInPath(99,99) is true PASS ctx.isPointInPath(149,149) is false PASS ctx.isPointInPath(199,199) is true PASS ctx.isPointInPath(249,249) is true PASS successfullyParsed is true TEST COMPLETE