Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
// OffscreenCanvas test in a worker:2d.path.isPointInStroke.nobitmap
// Description:isPointInStroke() works on a canvas with no bitmap
// Note:
importScripts("/resources/testharness.js");
importScripts("/html/canvas/resources/canvas-tests.js");
var t = async_test("isPointInStroke() works on a canvas with no bitmap");
var t_pass = t.done.bind(t);
var t_fail = t.step_func(function(reason) {
throw reason;
});
t.step(function() {
var canvas = new OffscreenCanvas(0, 0);
var ctx = canvas.getContext('2d');
ctx.lineWidth = 10;
ctx.moveTo(0, 10);
ctx.lineTo(40, 10);
_assertSame(ctx.isPointInStroke(20, 10), true, "ctx.isPointInStroke(20, 10)", "true");
_assertSame(ctx.isPointInStroke(20, 14), true, "ctx.isPointInStroke(20, 14)", "true");
_assertSame(ctx.isPointInStroke(20, 20), false, "ctx.isPointInStroke(20, 20)", "false");
_assertSame(ctx.isPointInStroke(60, 10), false, "ctx.isPointInStroke(60, 10)", "false");
t.done();
});
done();