OLD | NEW |
| (Empty) |
1 // DO NOT EDIT! This test has been generated by tools/gentest.py. | |
2 // OffscreenCanvas test in a worker:2d.path.arcTo.scale | |
3 // Description:arcTo scales the curve, not just the control points | |
4 // Note: | |
5 | |
6 importScripts("/resources/testharness.js"); | |
7 importScripts("/common/canvas-tests.js"); | |
8 | |
9 var t = async_test("arcTo scales the curve, not just the control points"); | |
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.fillStyle = '#0f0'; | |
18 ctx.beginPath(); | |
19 ctx.moveTo(0, 50); | |
20 ctx.translate(100, 0); | |
21 ctx.scale(0.1, 1); | |
22 ctx.arcTo(50, 50, 50, 0, 50); | |
23 ctx.lineTo(-1000, 0); | |
24 ctx.fill(); | |
25 _assertPixel(offscreenCanvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); | |
26 _assertPixel(offscreenCanvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); | |
27 _assertPixel(offscreenCanvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); | |
28 _assertPixel(offscreenCanvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); | |
29 _assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); | |
30 _assertPixel(offscreenCanvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); | |
31 _assertPixel(offscreenCanvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); | |
32 _assertPixel(offscreenCanvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); | |
33 _assertPixel(offscreenCanvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); | |
34 | |
35 t.done(); | |
36 | |
37 }); | |
38 done(); | |
OLD | NEW |