Index: third_party/WebKit/LayoutTests/http/tests/security/cross-origin-OffscreenCanvas2D-convertToBlob.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-OffscreenCanvas2D-convertToBlob.html b/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-OffscreenCanvas2D-convertToBlob.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..270532bd29a1254e029aaed6d0757c7bbadf5f75 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-OffscreenCanvas2D-convertToBlob.html |
@@ -0,0 +1,23 @@ |
+<!DOCTYPE html> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+<script> |
+ |
+async_test(function(t) { |
+ var image = document.createElement('img'); |
+ image.src = 'http://localhost:8080/security/resources/abe.png'; |
+ image.addEventListener('load', function() { |
+ var offscreenCanvas = new OffscreenCanvas(10, 10); |
+ var ctx = offscreenCanvas.getContext('2d'); |
+ ctx.drawImage(image, 0, 0); |
+ offscreenCanvas.convertToBlob().then(t.step_func_done(function() { |
+ assert_false("convertToBlob on a tainted OffscreenCanvas didn't throw, but should be"); |
+ }), t.step_func_done(function(e) { |
+ assert_true(e instanceof DOMException); |
+ assert_equals(e.name, "SecurityError"); |
+ })); |
+ }); |
+}, "Test that call convertToBlob on a tainted OffscreenCanvas throws exception"); |
+ |
+</script> |
+ |