2d.path.moveTo.nonfinite.worker.js (950B)
1 // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. 2 // OffscreenCanvas test in a worker:2d.path.moveTo.nonfinite 3 // Description:moveTo() 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("moveTo() 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.moveTo(0, 0); 20 ctx.lineTo(100, 0); 21 ctx.moveTo(Infinity, 50); 22 ctx.moveTo(-Infinity, 50); 23 ctx.moveTo(NaN, 50); 24 ctx.moveTo(0, Infinity); 25 ctx.moveTo(0, -Infinity); 26 ctx.moveTo(0, NaN); 27 ctx.moveTo(Infinity, Infinity); 28 ctx.lineTo(100, 50); 29 ctx.lineTo(0, 50); 30 ctx.fillStyle = '#0f0'; 31 ctx.fill(); 32 _assertPixel(canvas, 50,25, 0,255,0,255); 33 t.done(); 34 }); 35 done();