| 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 window.jsTestIsAsync = true; | |
| 11 | |
| 12 var worker = new Worker('./resources/OffscreenCanvas-transferable.js'); | |
| 13 | |
| 14 var width = 50; | |
| 15 var height = 50; | |
| 16 var canvas = document.createElement("canvas"); | |
| 17 canvas.width = width; | |
| 18 canvas.height = height; | |
| 19 var newOffscreenCanvas; | |
| 20 | |
| 21 var offscreenCanvas = canvas.transferControlToOffscreen(); | |
| 22 shouldBe("offscreenCanvas.width", "width"); | |
| 23 shouldBe("offscreenCanvas.height", "height"); | |
| 24 | |
| 25 worker.postMessage({data: offscreenCanvas}, [offscreenCanvas]); | |
| 26 shouldBe("offscreenCanvas.width", "0"); | |
| 27 shouldBe("offscreenCanvas.height", "0"); | |
| 28 | |
| 29 worker.onmessage = function(e) { | |
| 30 newOffscreenCanvas = e.data.data; | |
| 31 shouldBe("newOffscreenCanvas.width", "width"); | |
| 32 shouldBe("newOffscreenCanvas.height", "height"); | |
| 33 finishJSTest(); | |
| 34 } | |
| 35 </script> | |
| 36 </body> | |
| 37 </html> | |
| OLD | NEW |