OLD | NEW |
| (Empty) |
1 // DO NOT EDIT! This test has been generated by 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("/common/canvas-tests.js"); | |
8 | |
9 var t = async_test("arc() 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.fillStyle = '#f00'; | |
16 ctx.fillRect(0, 0, 100, 50); | |
17 ctx.moveTo(0, 0); | |
18 ctx.lineTo(100, 0); | |
19 ctx.arc(Infinity, 0, 50, 0, 2*Math.PI, true); | |
20 ctx.arc(-Infinity, 0, 50, 0, 2*Math.PI, true); | |
21 ctx.arc(NaN, 0, 50, 0, 2*Math.PI, true); | |
22 ctx.arc(0, Infinity, 50, 0, 2*Math.PI, true); | |
23 ctx.arc(0, -Infinity, 50, 0, 2*Math.PI, true); | |
24 ctx.arc(0, NaN, 50, 0, 2*Math.PI, true); | |
25 ctx.arc(0, 0, Infinity, 0, 2*Math.PI, true); | |
26 ctx.arc(0, 0, -Infinity, 0, 2*Math.PI, true); | |
27 ctx.arc(0, 0, NaN, 0, 2*Math.PI, true); | |
28 ctx.arc(0, 0, 50, Infinity, 2*Math.PI, true); | |
29 ctx.arc(0, 0, 50, -Infinity, 2*Math.PI, true); | |
30 ctx.arc(0, 0, 50, NaN, 2*Math.PI, true); | |
31 ctx.arc(0, 0, 50, 0, Infinity, true); | |
32 ctx.arc(0, 0, 50, 0, -Infinity, true); | |
33 ctx.arc(0, 0, 50, 0, NaN, true); | |
34 ctx.arc(Infinity, Infinity, 50, 0, 2*Math.PI, true); | |
35 ctx.arc(Infinity, Infinity, Infinity, 0, 2*Math.PI, true); | |
36 ctx.arc(Infinity, Infinity, Infinity, Infinity, 2*Math.PI, true); | |
37 ctx.arc(Infinity, Infinity, Infinity, Infinity, Infinity, true); | |
38 ctx.arc(Infinity, Infinity, Infinity, 0, Infinity, true); | |
39 ctx.arc(Infinity, Infinity, 50, Infinity, 2*Math.PI, true); | |
40 ctx.arc(Infinity, Infinity, 50, Infinity, Infinity, true); | |
41 ctx.arc(Infinity, Infinity, 50, 0, Infinity, true); | |
42 ctx.arc(Infinity, 0, Infinity, 0, 2*Math.PI, true); | |
43 ctx.arc(Infinity, 0, Infinity, Infinity, 2*Math.PI, true); | |
44 ctx.arc(Infinity, 0, Infinity, Infinity, Infinity, true); | |
45 ctx.arc(Infinity, 0, Infinity, 0, Infinity, true); | |
46 ctx.arc(Infinity, 0, 50, Infinity, 2*Math.PI, true); | |
47 ctx.arc(Infinity, 0, 50, Infinity, Infinity, true); | |
48 ctx.arc(Infinity, 0, 50, 0, Infinity, true); | |
49 ctx.arc(0, Infinity, Infinity, 0, 2*Math.PI, true); | |
50 ctx.arc(0, Infinity, Infinity, Infinity, 2*Math.PI, true); | |
51 ctx.arc(0, Infinity, Infinity, Infinity, Infinity, true); | |
52 ctx.arc(0, Infinity, Infinity, 0, Infinity, true); | |
53 ctx.arc(0, Infinity, 50, Infinity, 2*Math.PI, true); | |
54 ctx.arc(0, Infinity, 50, Infinity, Infinity, true); | |
55 ctx.arc(0, Infinity, 50, 0, Infinity, true); | |
56 ctx.arc(0, 0, Infinity, Infinity, 2*Math.PI, true); | |
57 ctx.arc(0, 0, Infinity, Infinity, Infinity, true); | |
58 ctx.arc(0, 0, Infinity, 0, Infinity, true); | |
59 ctx.arc(0, 0, 50, Infinity, Infinity, true); | |
60 ctx.lineTo(100, 50); | |
61 ctx.lineTo(0, 50); | |
62 ctx.fillStyle = '#0f0'; | |
63 ctx.fill(); | |
64 _assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); | |
65 _assertPixel(offscreenCanvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); | |
66 | |
67 t.done(); | |
68 | |
69 }); | |
70 done(); | |
OLD | NEW |