2d.path.arc.nonfinite.worker.js (2980B)
1 // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. 2 // OffscreenCanvas test in a worker:2d.path.arc.nonfinite 3 // Description:arc() 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("arc() 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 = '#f00'; 20 ctx.fillRect(0, 0, 100, 50); 21 ctx.moveTo(0, 0); 22 ctx.lineTo(100, 0); 23 ctx.arc(Infinity, 0, 50, 0, 2*Math.PI, true); 24 ctx.arc(-Infinity, 0, 50, 0, 2*Math.PI, true); 25 ctx.arc(NaN, 0, 50, 0, 2*Math.PI, true); 26 ctx.arc(0, Infinity, 50, 0, 2*Math.PI, true); 27 ctx.arc(0, -Infinity, 50, 0, 2*Math.PI, true); 28 ctx.arc(0, NaN, 50, 0, 2*Math.PI, true); 29 ctx.arc(0, 0, Infinity, 0, 2*Math.PI, true); 30 ctx.arc(0, 0, -Infinity, 0, 2*Math.PI, true); 31 ctx.arc(0, 0, NaN, 0, 2*Math.PI, true); 32 ctx.arc(0, 0, 50, Infinity, 2*Math.PI, true); 33 ctx.arc(0, 0, 50, -Infinity, 2*Math.PI, true); 34 ctx.arc(0, 0, 50, NaN, 2*Math.PI, true); 35 ctx.arc(0, 0, 50, 0, Infinity, true); 36 ctx.arc(0, 0, 50, 0, -Infinity, true); 37 ctx.arc(0, 0, 50, 0, NaN, true); 38 ctx.arc(Infinity, Infinity, 50, 0, 2*Math.PI, true); 39 ctx.arc(Infinity, Infinity, Infinity, 0, 2*Math.PI, true); 40 ctx.arc(Infinity, Infinity, Infinity, Infinity, 2*Math.PI, true); 41 ctx.arc(Infinity, Infinity, Infinity, Infinity, Infinity, true); 42 ctx.arc(Infinity, Infinity, Infinity, 0, Infinity, true); 43 ctx.arc(Infinity, Infinity, 50, Infinity, 2*Math.PI, true); 44 ctx.arc(Infinity, Infinity, 50, Infinity, Infinity, true); 45 ctx.arc(Infinity, Infinity, 50, 0, Infinity, true); 46 ctx.arc(Infinity, 0, Infinity, 0, 2*Math.PI, true); 47 ctx.arc(Infinity, 0, Infinity, Infinity, 2*Math.PI, true); 48 ctx.arc(Infinity, 0, Infinity, Infinity, Infinity, true); 49 ctx.arc(Infinity, 0, Infinity, 0, Infinity, true); 50 ctx.arc(Infinity, 0, 50, Infinity, 2*Math.PI, true); 51 ctx.arc(Infinity, 0, 50, Infinity, Infinity, true); 52 ctx.arc(Infinity, 0, 50, 0, Infinity, true); 53 ctx.arc(0, Infinity, Infinity, 0, 2*Math.PI, true); 54 ctx.arc(0, Infinity, Infinity, Infinity, 2*Math.PI, true); 55 ctx.arc(0, Infinity, Infinity, Infinity, Infinity, true); 56 ctx.arc(0, Infinity, Infinity, 0, Infinity, true); 57 ctx.arc(0, Infinity, 50, Infinity, 2*Math.PI, true); 58 ctx.arc(0, Infinity, 50, Infinity, Infinity, true); 59 ctx.arc(0, Infinity, 50, 0, Infinity, true); 60 ctx.arc(0, 0, Infinity, Infinity, 2*Math.PI, true); 61 ctx.arc(0, 0, Infinity, Infinity, Infinity, true); 62 ctx.arc(0, 0, Infinity, 0, Infinity, true); 63 ctx.arc(0, 0, 50, Infinity, Infinity, true); 64 ctx.lineTo(100, 50); 65 ctx.lineTo(0, 50); 66 ctx.fillStyle = '#0f0'; 67 ctx.fill(); 68 _assertPixel(canvas, 50,25, 0,255,0,255); 69 _assertPixel(canvas, 90,45, 0,255,0,255); 70 t.done(); 71 }); 72 done();