testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cross.html
author Sandor Molnar <smolnar@mozilla.com>
Thu, 29 Sep 2022 04:48:26 +0300
changeset 636564 59ab3186dfd4016b98a1dc97ea9ba146cb9f7abc
parent 604175 8c8326a5e1017f214639db0061c86bad7911f51d
permissions -rw-r--r--
Backed out 2 changesets (bug 1774317) for causing top-crash (bug 1792767) CLOSED TREE Backed out changeset 418dec4ac3f9 (bug 1774317) Backed out changeset 329666086b40 (bug 1774317)

<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<title>OffscreenCanvas test: 2d.line.cross</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/html/canvas/resources/canvas-tests.js"></script>

<h1>2d.line.cross</h1>
<p class="desc"></p>


<script>
var t = async_test("");
var t_pass = t.done.bind(t);
var t_fail = t.step_func(function(reason) {
    throw reason;
});
t.step(function() {

var canvas = new OffscreenCanvas(100, 50);
var ctx = canvas.getContext('2d');

ctx.fillStyle = '#0f0';
ctx.fillRect(0, 0, 100, 50);
ctx.lineWidth = 200;
ctx.lineJoin = 'bevel';
ctx.strokeStyle = '#f00';
ctx.beginPath();
ctx.moveTo(110, 50);
ctx.lineTo(110, 60);
ctx.lineTo(100, 60);
ctx.stroke();
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");
_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
t.done();

});
</script>