OLD | NEW |
(Empty) | |
| 1 // DO NOT EDIT! This test has been generated by tools/gentest.py. |
| 2 // OffscreenCanvas test in a worker:2d.path.isPointInPath.bezier |
| 3 // Description:isPointInPath() works on Bezier curves |
| 4 // Note: |
| 5 |
| 6 importScripts("/resources/testharness.js"); |
| 7 importScripts("/common/canvas-tests.js"); |
| 8 |
| 9 var t = async_test("isPointInPath() works on Bezier curves"); |
| 10 t.step(function() { |
| 11 |
| 12 var offscreenCanvas = new OffscreenCanvas(100, 50); |
| 13 var ctx = offscreenCanvas.getContext('2d'); |
| 14 |
| 15 ctx.moveTo(25, 25); |
| 16 ctx.bezierCurveTo(50, -50, 50, 100, 75, 25); |
| 17 _assertSame(ctx.isPointInPath(25, 20), false, "ctx.isPointInPath(25, 20)", "fals
e"); |
| 18 _assertSame(ctx.isPointInPath(25, 30), false, "ctx.isPointInPath(25, 30)", "fals
e"); |
| 19 _assertSame(ctx.isPointInPath(30, 20), true, "ctx.isPointInPath(30, 20)", "true"
); |
| 20 _assertSame(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "fals
e"); |
| 21 _assertSame(ctx.isPointInPath(40, 2), false, "ctx.isPointInPath(40, 2)", "false"
); |
| 22 _assertSame(ctx.isPointInPath(40, 20), true, "ctx.isPointInPath(40, 20)", "true"
); |
| 23 _assertSame(ctx.isPointInPath(40, 30), false, "ctx.isPointInPath(40, 30)", "fals
e"); |
| 24 _assertSame(ctx.isPointInPath(40, 47), false, "ctx.isPointInPath(40, 47)", "fals
e"); |
| 25 _assertSame(ctx.isPointInPath(45, 20), true, "ctx.isPointInPath(45, 20)", "true"
); |
| 26 _assertSame(ctx.isPointInPath(45, 30), false, "ctx.isPointInPath(45, 30)", "fals
e"); |
| 27 _assertSame(ctx.isPointInPath(55, 20), false, "ctx.isPointInPath(55, 20)", "fals
e"); |
| 28 _assertSame(ctx.isPointInPath(55, 30), true, "ctx.isPointInPath(55, 30)", "true"
); |
| 29 _assertSame(ctx.isPointInPath(60, 2), false, "ctx.isPointInPath(60, 2)", "false"
); |
| 30 _assertSame(ctx.isPointInPath(60, 20), false, "ctx.isPointInPath(60, 20)", "fals
e"); |
| 31 _assertSame(ctx.isPointInPath(60, 30), true, "ctx.isPointInPath(60, 30)", "true"
); |
| 32 _assertSame(ctx.isPointInPath(60, 47), false, "ctx.isPointInPath(60, 47)", "fals
e"); |
| 33 _assertSame(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "fals
e"); |
| 34 _assertSame(ctx.isPointInPath(70, 30), true, "ctx.isPointInPath(70, 30)", "true"
); |
| 35 _assertSame(ctx.isPointInPath(75, 20), false, "ctx.isPointInPath(75, 20)", "fals
e"); |
| 36 _assertSame(ctx.isPointInPath(75, 30), false, "ctx.isPointInPath(75, 30)", "fals
e"); |
| 37 |
| 38 t.done(); |
| 39 |
| 40 }); |
| 41 done(); |
OLD | NEW |