Index: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/embedding_csp-header.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/embedding_csp-header.html b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/embedding_csp-header.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3add0fb560395abaab21f1f4d2704f220ced2bd9 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/embedding_csp-header.html |
@@ -0,0 +1,39 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+ <script src="/resources/testharness.js"></script> |
+ <script src="/resources/testharnessreport.js"></script> |
+</head> |
+<body> |
+ <script> |
+ async_test(t => { |
+ var i = document.createElement('iframe'); |
+ i.src = '../resources/get-embedding-csp-header.php'; |
+ |
+ window.addEventListener('message', t.step_func(e => { |
+ if (e.source != i.contentWindow) |
+ return; |
+ assert_equals('null', e.data); |
+ t.done(); |
+ })); |
+ |
+ document.body.appendChild(i); |
+ }, "Embedding_CSP is not sent if csp attribute is not set on <iframe>."); |
+ |
+ async_test(t => { |
+ var i = document.createElement('iframe'); |
+ i.csp = 'value'; |
+ i.src = '../resources/get-embedding-csp-header.php'; |
+ |
+ window.addEventListener('message', t.step_func(e => { |
+ if (e.source != i.contentWindow) |
+ return; |
+ assert_equals('value', e.data); |
+ t.done(); |
+ })); |
+ |
+ document.body.appendChild(i); |
+ }, "<iframe csp> sends an Embedding-CSP request header."); |
+ </script> |
+</body> |
+</html> |