| OLD | NEW |
| (Empty) |
| 1 // DO NOT EDIT! This test has been generated by tools/gentest.py. | |
| 2 // OffscreenCanvas test in a worker:initial.reset.pattern | |
| 3 // Description:Resetting the canvas state does not invalidate any existing patte
rns | |
| 4 // Note: | |
| 5 | |
| 6 importScripts("/resources/testharness.js"); | |
| 7 importScripts("/common/canvas-tests.js"); | |
| 8 | |
| 9 var t = async_test("Resetting the canvas state does not invalidate any existing
patterns"); | |
| 10 t.step(function() { | |
| 11 | |
| 12 var offscreenCanvas = new OffscreenCanvas(100, 50); | |
| 13 var ctx = offscreenCanvas.getContext('2d'); | |
| 14 | |
| 15 offscreenCanvas.width = 30; | |
| 16 ctx.fillStyle = '#0f0'; | |
| 17 ctx.fillRect(0, 0, 30, 50); | |
| 18 var p = ctx.createPattern(offscreenCanvas, 'repeat-x'); | |
| 19 offscreenCanvas.width = 100; | |
| 20 ctx.fillStyle = '#f00'; | |
| 21 ctx.fillRect(0, 0, 100, 50); | |
| 22 ctx.fillStyle = p; | |
| 23 ctx.fillRect(0, 0, 100, 50); | |
| 24 _assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); | |
| 25 | |
| 26 t.done(); | |
| 27 | |
| 28 }); | |
| 29 done(); | |
| OLD | NEW |