OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 <script> |
| 8 |
| 9 description("Test OffscreenCanvas transferable with exception cases."); |
| 10 |
| 11 var worker = new Worker('./resources/OffscreenCanvas-transferable.js'); |
| 12 |
| 13 var width = 50; |
| 14 var height = 50; |
| 15 var offscreenCanvas1 = new OffscreenCanvas(width, height); |
| 16 |
| 17 var ctx; |
| 18 shouldNotThrow("ctx = offscreenCanvas1.getContext('2d')"); |
| 19 shouldBeType("ctx", "OffscreenCanvasRenderingContext2D"); |
| 20 shouldThrow("worker.postMessage({data: offscreenCanvas1}, [offscreenCanvas1])"); |
| 21 |
| 22 var offscreenCanvas2 = new OffscreenCanvas(width, height); |
| 23 worker.postMessage({data: offscreenCanvas2}, [offscreenCanvas2]); |
| 24 shouldThrow("offscreenCanvas2.transferToImageBitmap()"); |
| 25 |
| 26 shouldThrow("worker.postMessage({data: offscreenCanvas2}, [offscreenCanvas2])"); |
| 27 shouldThrow("offscreenCanvas2.getContext('2d')"); |
| 28 |
| 29 finishJSTest(); |
| 30 </script> |
| 31 </body> |
| 32 </html> |
OLD | NEW |