2d.strokeRect.nonfinite.worker.js (1741B)
1 // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. 2 // OffscreenCanvas test in a worker:2d.strokeRect.nonfinite 3 // Description:strokeRect() with Infinity/NaN is ignored 4 // Note: 5 6 importScripts("/resources/testharness.js"); 7 importScripts("/html/canvas/resources/canvas-tests.js"); 8 9 var t = async_test("strokeRect() with Infinity/NaN is ignored"); 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() { 15 16 var canvas = new OffscreenCanvas(100, 50); 17 var ctx = canvas.getContext('2d'); 18 19 ctx.fillStyle = '#0f0'; 20 ctx.fillRect(0, 0, 100, 50); 21 ctx.strokeStyle = '#f00'; 22 ctx.lineWidth = 150; 23 ctx.strokeRect(Infinity, 0, 100, 50); 24 ctx.strokeRect(-Infinity, 0, 100, 50); 25 ctx.strokeRect(NaN, 0, 100, 50); 26 ctx.strokeRect(0, Infinity, 100, 50); 27 ctx.strokeRect(0, -Infinity, 100, 50); 28 ctx.strokeRect(0, NaN, 100, 50); 29 ctx.strokeRect(0, 0, Infinity, 50); 30 ctx.strokeRect(0, 0, -Infinity, 50); 31 ctx.strokeRect(0, 0, NaN, 50); 32 ctx.strokeRect(0, 0, 100, Infinity); 33 ctx.strokeRect(0, 0, 100, -Infinity); 34 ctx.strokeRect(0, 0, 100, NaN); 35 ctx.strokeRect(Infinity, Infinity, 100, 50); 36 ctx.strokeRect(Infinity, Infinity, Infinity, 50); 37 ctx.strokeRect(Infinity, Infinity, Infinity, Infinity); 38 ctx.strokeRect(Infinity, Infinity, 100, Infinity); 39 ctx.strokeRect(Infinity, 0, Infinity, 50); 40 ctx.strokeRect(Infinity, 0, Infinity, Infinity); 41 ctx.strokeRect(Infinity, 0, 100, Infinity); 42 ctx.strokeRect(0, Infinity, Infinity, 50); 43 ctx.strokeRect(0, Infinity, Infinity, Infinity); 44 ctx.strokeRect(0, Infinity, 100, Infinity); 45 ctx.strokeRect(0, 0, Infinity, Infinity); 46 _assertPixel(canvas, 50,25, 0,255,0,255); 47 t.done(); 48 }); 49 done();