Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked.html

Issue 2146633002: Enable checking for Content Security Policies before loading an external worklet script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..aacff764bbb8013e7ca62ec491c97545e1b925c5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/worklet-import-blocked.html
@@ -0,0 +1,22 @@
+<!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.')
+ }).catch(function(error) {
yhirano 2016/07/21 05:16:56 This catches the assert_unreached exception. I wou
+ 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>

Powered by Google App Engine
This is Rietveld 408576698