Index: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferable-exceptions.html |
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferable-exceptions.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferable-exceptions.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..18dc0b0a6fc17fa6804a5b67de29b92a75fe1adc |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-transferable-exceptions.html |
@@ -0,0 +1,32 @@ |
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
+<html> |
+<head> |
+<script src="../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<script> |
+ |
+description("Test OffscreenCanvas transferable with exception cases."); |
+ |
+var worker = new Worker('./resources/OffscreenCanvas-transferable.js'); |
+ |
+var width = 50; |
+var height = 50; |
+var offscreenCanvas1 = new OffscreenCanvas(width, height); |
+ |
+var ctx; |
+shouldNotThrow("ctx = offscreenCanvas1.getContext('2d')"); |
+shouldBeType("ctx", "OffscreenCanvasRenderingContext2D"); |
+shouldThrow("worker.postMessage({data: offscreenCanvas1}, [offscreenCanvas1])"); |
+ |
+var offscreenCanvas2 = new OffscreenCanvas(width, height); |
+worker.postMessage({data: offscreenCanvas2}, [offscreenCanvas2]); |
+shouldThrow("offscreenCanvas2.transferToImageBitmap()"); |
+ |
+shouldThrow("worker.postMessage({data: offscreenCanvas2}, [offscreenCanvas2])"); |
+shouldThrow("offscreenCanvas2.getContext('2d')"); |
+ |
+finishJSTest(); |
+</script> |
+</body> |
+</html> |