| OLD | NEW |
| (Empty) |
| 1 // DO NOT EDIT! This test has been generated by tools/gentest.py. | |
| 2 // OffscreenCanvas test in a worker:2d.pattern.basic.zerocanvas | |
| 3 // Description: | |
| 4 // Note: | |
| 5 | |
| 6 importScripts("/resources/testharness.js"); | |
| 7 importScripts("/common/canvas-tests.js"); | |
| 8 | |
| 9 var t = async_test(""); | |
| 10 t.step(function() { | |
| 11 | |
| 12 var offscreenCanvas = new OffscreenCanvas(100, 50); | |
| 13 var ctx = offscreenCanvas.getContext('2d'); | |
| 14 | |
| 15 offscreenCanvas.width = 0; | |
| 16 offscreenCanvas.height = 10; | |
| 17 _assertSame(offscreenCanvas.width, 0, "offscreenCanvas.width", "0"); | |
| 18 _assertSame(offscreenCanvas.height, 10, "offscreenCanvas.height", "10"); | |
| 19 assert_throws("INVALID_STATE_ERR", function() { ctx.createPattern(offscreenCanva
s, 'repeat'); }); | |
| 20 offscreenCanvas.width = 10; | |
| 21 offscreenCanvas.height = 0; | |
| 22 _assertSame(offscreenCanvas.width, 10, "offscreenCanvas.width", "10"); | |
| 23 _assertSame(offscreenCanvas.height, 0, "offscreenCanvas.height", "0"); | |
| 24 assert_throws("INVALID_STATE_ERR", function() { ctx.createPattern(offscreenCanva
s, 'repeat'); }); | |
| 25 offscreenCanvas.width = 0; | |
| 26 offscreenCanvas.height = 0; | |
| 27 _assertSame(offscreenCanvas.width, 0, "offscreenCanvas.width", "0"); | |
| 28 _assertSame(offscreenCanvas.height, 0, "offscreenCanvas.height", "0"); | |
| 29 assert_throws("INVALID_STATE_ERR", function() { ctx.createPattern(offscreenCanva
s, 'repeat'); }); | |
| 30 | |
| 31 t.done(); | |
| 32 | |
| 33 }); | |
| 34 done(); | |
| OLD | NEW |