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