Index: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html |
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html |
index e881b63c0d1e52d926029c1165e6cee65f3e4559..e541808549b9485387e0a383c4e305a6bc0debf4 100644 |
--- a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html |
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferControlToOffscreen.html |
@@ -46,6 +46,26 @@ test(function() { |
assert_throws("InvalidStateError", function() { offscreenCanvas3.height = 20; }); |
}, "Test if resizing on offscreencanvas transferred from html canvas has thrown exceptions."); |
+test(function() { |
+ var canvas4 = createCanvas(10, 10); |
+ var offscreenCanvas4 = canvas4.transferControlToOffscreen(); |
+ assert_throws("InvalidStateError", function() { |
+ canvas4.getContext("2d"); |
+ }, "canvas.getContext() is not allowed after transferring control to offscreen."); |
+ assert_throws("InvalidStateError", function() { |
+ canvas4.height = 20; |
+ }, "canvas resizing height is not allowed after transferring control to offscreen."); |
+ assert_throws("InvalidStateError", function() { |
+ canvas4.width = 20; |
+ }, "canvas resizing width is not allowed after transferring control to offscreen."); |
+ assert_throws("InvalidStateError", function() { |
+ canvas4.toBlob(function() {}); |
+ }, "canvas.toBlob is not allowed after transferring control to offscreen."); |
+ assert_throws("InvalidStateError", function() { |
+ canvas4.toDataURL(); |
+ }, "canvas.toDataURL is not allowed after transferring control to offscreen."); |
+}, "Test if modifying canvas after it transfers controls to offscreen throw exceptions"); |
+ |
</script> |
</body> |
</html> |