Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<meta charset="UTF-8">
<title>Canvas test: 2d.path.isPointInStroke.nobitmap.path2d</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/html/canvas/resources/canvas-tests.js"></script>
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
<body class="show_output">
<h1>2d.path.isPointInStroke.nobitmap.path2d</h1>
<p class="desc">isPointInStroke(path) works on a canvas with no bitmap</p>
<p class="output">Actual output:</p>
<canvas id="c" class="output" width="0" height="0"><p class="fallback">FAIL (fallback content)</p></canvas>
<ul id="d"></ul>
<script>
var t = async_test("isPointInStroke(path) works on a canvas with no bitmap");
_addTest(function(canvas, ctx) {
var path = new Path2D();
path.moveTo(0, 10);
path.lineTo(40, 10);
ctx.lineWidth = 10;
_assertSame(ctx.isPointInStroke(path, 20, 10), true, "ctx.isPointInStroke(path, 20, 10)", "true");
_assertSame(ctx.isPointInStroke(path, 20, 20), false, "ctx.isPointInStroke(path, 20, 20)", "false");
});
</script>