Bug 1794662 [wpt PR 36401] - Batch-remove unused arguments in _assertPixel and _asser...
[gecko.git] / testing / web-platform / tests / html / canvas / offscreen / fill-and-stroke-styles / 2d.gradient.interpolate.zerosize.strokeRect.worker.js
blob0949fc8a1952f2c191407f569818c24a615f9bef
1 // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
2 // OffscreenCanvas test in a worker:2d.gradient.interpolate.zerosize.strokeRect
3 // Description:
4 // Note:
6 importScripts("/resources/testharness.js");
7 importScripts("/html/canvas/resources/canvas-tests.js");
9 var t = async_test("");
10 var t_pass = t.done.bind(t);
11 var t_fail = t.step_func(function(reason) {
12     throw reason;
13 });
14 t.step(function() {
16 var canvas = new OffscreenCanvas(100, 50);
17 var ctx = canvas.getContext('2d');
19 ctx.fillStyle = '#0f0';
20 ctx.fillRect(0, 0, 100, 50);
21 var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction)
22 g.addColorStop(0, '#f00');
23 g.addColorStop(1, '#f00');
24 ctx.strokeStyle = g;
25 ctx.strokeRect(20, 20, 60, 10);
26 _assertPixel(canvas, 19,19, 0,255,0,255);
27 _assertPixel(canvas, 20,19, 0,255,0,255);
28 _assertPixel(canvas, 21,19, 0,255,0,255);
29 _assertPixel(canvas, 19,20, 0,255,0,255);
30 _assertPixel(canvas, 20,20, 0,255,0,255);
31 _assertPixel(canvas, 21,20, 0,255,0,255);
32 _assertPixel(canvas, 19,21, 0,255,0,255);
33 _assertPixel(canvas, 20,21, 0,255,0,255);
34 _assertPixel(canvas, 21,21, 0,255,0,255);
35 t.done();
37 });
38 done();