Bug 1794662 [wpt PR 36401] - Batch-remove unused arguments in _assertPixel and _asser...
[gecko.git] / testing / web-platform / tests / html / canvas / offscreen / line-styles / 2d.line.cap.closed.html
blob0a3f3fcab77edc110f8e338ce78a9b561b96d16f
1 <!DOCTYPE html>
2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
3 <title>OffscreenCanvas test: 2d.line.cap.closed</title>
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 <script src="/html/canvas/resources/canvas-tests.js"></script>
8 <h1>2d.line.cap.closed</h1>
9 <p class="desc">Line caps are not drawn at the corners of an unclosed rectangle</p>
12 <script>
13 var t = async_test("Line caps are not drawn at the corners of an unclosed rectangle");
14 var t_pass = t.done.bind(t);
15 var t_fail = t.step_func(function(reason) {
16 throw reason;
17 });
18 t.step(function() {
20 var canvas = new OffscreenCanvas(100, 50);
21 var ctx = canvas.getContext('2d');
23 ctx.fillStyle = '#0f0';
24 ctx.strokeStyle = '#f00';
25 ctx.fillRect(0, 0, 100, 50);
26 ctx.lineJoin = 'bevel';
27 ctx.lineCap = 'square';
28 ctx.lineWidth = 400;
29 ctx.beginPath();
30 ctx.moveTo(200, 200);
31 ctx.lineTo(200, 1000);
32 ctx.lineTo(1000, 1000);
33 ctx.lineTo(1000, 200);
34 ctx.closePath();
35 ctx.stroke();
36 _assertPixel(canvas, 1,1, 0,255,0,255);
37 _assertPixel(canvas, 48,1, 0,255,0,255);
38 _assertPixel(canvas, 48,48, 0,255,0,255);
39 _assertPixel(canvas, 1,48, 0,255,0,255);
40 t.done();
42 });
43 </script>