OLD | NEW |
| (Empty) |
1 // DO NOT EDIT! This test has been generated by tools/gentest.py. | |
2 // OffscreenCanvas test in a worker:2d.path.rect.nonfinite | |
3 // Description:rect() 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("rect() 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.rect(Infinity, 50, 1, 1); | |
18 ctx.rect(-Infinity, 50, 1, 1); | |
19 ctx.rect(NaN, 50, 1, 1); | |
20 ctx.rect(0, Infinity, 1, 1); | |
21 ctx.rect(0, -Infinity, 1, 1); | |
22 ctx.rect(0, NaN, 1, 1); | |
23 ctx.rect(0, 50, Infinity, 1); | |
24 ctx.rect(0, 50, -Infinity, 1); | |
25 ctx.rect(0, 50, NaN, 1); | |
26 ctx.rect(0, 50, 1, Infinity); | |
27 ctx.rect(0, 50, 1, -Infinity); | |
28 ctx.rect(0, 50, 1, NaN); | |
29 ctx.rect(Infinity, Infinity, 1, 1); | |
30 ctx.rect(Infinity, Infinity, Infinity, 1); | |
31 ctx.rect(Infinity, Infinity, Infinity, Infinity); | |
32 ctx.rect(Infinity, Infinity, 1, Infinity); | |
33 ctx.rect(Infinity, 50, Infinity, 1); | |
34 ctx.rect(Infinity, 50, Infinity, Infinity); | |
35 ctx.rect(Infinity, 50, 1, Infinity); | |
36 ctx.rect(0, Infinity, Infinity, 1); | |
37 ctx.rect(0, Infinity, Infinity, Infinity); | |
38 ctx.rect(0, Infinity, 1, Infinity); | |
39 ctx.rect(0, 50, Infinity, Infinity); | |
40 ctx.lineTo(100, 50); | |
41 ctx.lineTo(0, 50); | |
42 ctx.fillStyle = '#0f0'; | |
43 ctx.fill(); | |
44 _assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); | |
45 _assertPixel(offscreenCanvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255"); | |
46 | |
47 t.done(); | |
48 | |
49 }); | |
50 done(); | |
OLD | NEW |