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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/embeddedEnforcement/embedding_csp-header.html

Issue 2372563002: Adding Embedding-CSP HTTP header (Closed)
Patch Set: Rebasing Created 4 years, 3 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/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>

Powered by Google App Engine
This is Rietveld 408576698