Index: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked.html b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ec11a1a45221813f608eb0eca13c2f499beee3f2 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked.html |
@@ -0,0 +1,24 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+ <script src="../../resources/testharness.js"></script> |
+ <script src="../../resources/testharnessreport.js"></script> |
+<meta http-equiv="Content-Security-Policy" content="default-src 'none';script-src 'unsafe-inline'"/> |
+ |
+</head> |
+<body> |
+<script> |
+ promise_test(function() { |
+ |
+ return paintWorklet.import('/resources/worklet.js').then( |
+ function(undefined_arg) { |
+ assert_unreached('import should fail.') |
+ }, |
+ function(error) { |
+ assert_equals(error.name, 'NetworkError', 'error should be a NetworkError.'); |
+ }); |
+ |
+ }, 'Importing a script rejects the given promise with NetworkError because it violated the same origin CSP policy.'); |
+</script> |
+</body> |
+</html> |