2d.path.arc.nonfinite.html (3134B)
1 <!DOCTYPE html> 2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> 3 <meta charset="UTF-8"> 4 <title>OffscreenCanvas test: 2d.path.arc.nonfinite</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="/html/canvas/resources/canvas-tests.js"></script> 8 9 <h1>2d.path.arc.nonfinite</h1> 10 <p class="desc">arc() with Infinity/NaN is ignored</p> 11 12 13 <script> 14 var t = async_test("arc() with Infinity/NaN is ignored"); 15 var t_pass = t.done.bind(t); 16 var t_fail = t.step_func(function(reason) { 17 throw reason; 18 }); 19 t.step(function() { 20 21 var canvas = new OffscreenCanvas(100, 50); 22 var ctx = canvas.getContext('2d'); 23 24 ctx.fillStyle = '#f00'; 25 ctx.fillRect(0, 0, 100, 50); 26 ctx.moveTo(0, 0); 27 ctx.lineTo(100, 0); 28 ctx.arc(Infinity, 0, 50, 0, 2*Math.PI, true); 29 ctx.arc(-Infinity, 0, 50, 0, 2*Math.PI, true); 30 ctx.arc(NaN, 0, 50, 0, 2*Math.PI, true); 31 ctx.arc(0, Infinity, 50, 0, 2*Math.PI, true); 32 ctx.arc(0, -Infinity, 50, 0, 2*Math.PI, true); 33 ctx.arc(0, NaN, 50, 0, 2*Math.PI, true); 34 ctx.arc(0, 0, Infinity, 0, 2*Math.PI, true); 35 ctx.arc(0, 0, -Infinity, 0, 2*Math.PI, true); 36 ctx.arc(0, 0, NaN, 0, 2*Math.PI, true); 37 ctx.arc(0, 0, 50, Infinity, 2*Math.PI, true); 38 ctx.arc(0, 0, 50, -Infinity, 2*Math.PI, true); 39 ctx.arc(0, 0, 50, NaN, 2*Math.PI, true); 40 ctx.arc(0, 0, 50, 0, Infinity, true); 41 ctx.arc(0, 0, 50, 0, -Infinity, true); 42 ctx.arc(0, 0, 50, 0, NaN, true); 43 ctx.arc(Infinity, Infinity, 50, 0, 2*Math.PI, true); 44 ctx.arc(Infinity, Infinity, Infinity, 0, 2*Math.PI, true); 45 ctx.arc(Infinity, Infinity, Infinity, Infinity, 2*Math.PI, true); 46 ctx.arc(Infinity, Infinity, Infinity, Infinity, Infinity, true); 47 ctx.arc(Infinity, Infinity, Infinity, 0, Infinity, true); 48 ctx.arc(Infinity, Infinity, 50, Infinity, 2*Math.PI, true); 49 ctx.arc(Infinity, Infinity, 50, Infinity, Infinity, true); 50 ctx.arc(Infinity, Infinity, 50, 0, Infinity, true); 51 ctx.arc(Infinity, 0, Infinity, 0, 2*Math.PI, true); 52 ctx.arc(Infinity, 0, Infinity, Infinity, 2*Math.PI, true); 53 ctx.arc(Infinity, 0, Infinity, Infinity, Infinity, true); 54 ctx.arc(Infinity, 0, Infinity, 0, Infinity, true); 55 ctx.arc(Infinity, 0, 50, Infinity, 2*Math.PI, true); 56 ctx.arc(Infinity, 0, 50, Infinity, Infinity, true); 57 ctx.arc(Infinity, 0, 50, 0, Infinity, true); 58 ctx.arc(0, Infinity, Infinity, 0, 2*Math.PI, true); 59 ctx.arc(0, Infinity, Infinity, Infinity, 2*Math.PI, true); 60 ctx.arc(0, Infinity, Infinity, Infinity, Infinity, true); 61 ctx.arc(0, Infinity, Infinity, 0, Infinity, true); 62 ctx.arc(0, Infinity, 50, Infinity, 2*Math.PI, true); 63 ctx.arc(0, Infinity, 50, Infinity, Infinity, true); 64 ctx.arc(0, Infinity, 50, 0, Infinity, true); 65 ctx.arc(0, 0, Infinity, Infinity, 2*Math.PI, true); 66 ctx.arc(0, 0, Infinity, Infinity, Infinity, true); 67 ctx.arc(0, 0, Infinity, 0, Infinity, true); 68 ctx.arc(0, 0, 50, Infinity, Infinity, true); 69 ctx.lineTo(100, 50); 70 ctx.lineTo(0, 50); 71 ctx.fillStyle = '#0f0'; 72 ctx.fill(); 73 _assertPixel(canvas, 50,25, 0,255,0,255); 74 _assertPixel(canvas, 90,45, 0,255,0,255); 75 t.done(); 76 77 }); 78 </script>