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 transferControlToOffscreen."); |
| 10 window.jsTestIsAsync = true; |
| 11 |
| 12 var width = 50; |
| 13 var height = 50; |
| 14 var canvas = document.createElement("canvas"); |
| 15 canvas.width = width; |
| 16 canvas.height = height; |
| 17 |
| 18 var offscreenCanvas = canvas.transferControlToOffscreen(); |
| 19 shouldBe("offscreenCanvas.width", "width"); |
| 20 shouldBe("offscreenCanvas.height", "height"); |
| 21 |
| 22 var ctx = canvas.getContext("2d"); |
| 23 try { |
| 24 offscreenCanvas = canvas.transferControlToOffscreen(); |
| 25 testFailed("transferControlToOffscreen from a canvas with context didn't thr
ow an exception."); |
| 26 } catch (ex) { |
| 27 testPassed("transferControlToOffscreen from a canvas with context throws an
exception: " + ex); |
| 28 } |
| 29 |
| 30 finishJSTest(); |
| 31 </script> |
| 32 </body> |
| 33 </html> |
OLD | NEW |