OLD | NEW |
(Empty) | |
| 1 // DO NOT EDIT! This test has been generated by 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("/common/canvas-tests.js"); |
| 8 |
| 9 var t = async_test("moveTo() with Infinity/NaN is ignored"); |
| 10 t.step(function() { |
| 11 |
| 12 var offscreenCanvas = new OffscreenCanvas(100, 50); |
| 13 var ctx = offscreenCanvas.getContext('2d'); |
| 14 |
| 15 ctx.moveTo(0, 0); |
| 16 ctx.lineTo(100, 0); |
| 17 ctx.moveTo(Infinity, 50); |
| 18 ctx.moveTo(-Infinity, 50); |
| 19 ctx.moveTo(NaN, 50); |
| 20 ctx.moveTo(0, Infinity); |
| 21 ctx.moveTo(0, -Infinity); |
| 22 ctx.moveTo(0, NaN); |
| 23 ctx.moveTo(Infinity, Infinity); |
| 24 ctx.lineTo(100, 50); |
| 25 ctx.lineTo(0, 50); |
| 26 ctx.fillStyle = '#0f0'; |
| 27 ctx.fill(); |
| 28 _assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); |
| 29 |
| 30 t.done(); |
| 31 |
| 32 }); |
| 33 done(); |
OLD | NEW |