| Index: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-isPointInPath-isPointInStroke.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-isPointInPath-isPointInStroke.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-isPointInPath-isPointInStroke.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..de0e1efb907e4fac114cbe90676acef982bdd655
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-isPointInPath-isPointInStroke.html
|
| @@ -0,0 +1,35 @@
|
| +<!DOCTYPE HTML>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script>
|
| +test(function() {
|
| + var offscreenCanvas = new OffscreenCanvas(100, 50);
|
| + var ctx = offscreenCanvas.getContext('2d');
|
| +
|
| + ctx.rect(0, 0, 20, 20);
|
| + assert_true(ctx.isPointInPath(10, 10));
|
| + assert_false(ctx.isPointInPath(30, 10));
|
| +
|
| + var path = new Path2D();
|
| + path.rect(20, 20, 100, 100);
|
| + assert_true(ctx.isPointInPath(path, 20, 20));
|
| + assert_false(ctx.isPointInPath(path, 130, 20));
|
| +}, 'Test the behavior of isPointInPath APIs for OffscreenCanvas');
|
| +
|
| +
|
| +test(function() {
|
| + var offscreenCanvas = new OffscreenCanvas(100, 50);
|
| + var ctx = offscreenCanvas.getContext('2d');
|
| +
|
| + ctx.strokeStyle = '#0f0';
|
| + ctx.beginPath();
|
| + ctx.rect(0, 0, 20, 20);
|
| + assert_true(ctx.isPointInStroke(0, 0));
|
| + assert_false(ctx.isPointInStroke(30, 10));
|
| +
|
| + var path = new Path2D();
|
| + path.rect(20, 20, 100, 100);
|
| + assert_true(ctx.isPointInStroke(path, 20, 20));
|
| + assert_true(ctx.isPointInStroke(path, 120, 20));
|
| +}, 'Test the behavior of isPointInStroke APIs for OffscreenCanvas');
|
| +</script>
|
|
|