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

Unified Diff: LayoutTests/http/tests/security/suborigins/suborigin-allow-in-http-header.php

Issue 27073003: CSP Suborigins Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address many of mkwst's comments Created 5 years, 8 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: LayoutTests/http/tests/security/suborigins/suborigin-allow-in-http-header.php
diff --git a/LayoutTests/http/tests/security/suborigins/suborigin-allow-in-http-header.php b/LayoutTests/http/tests/security/suborigins/suborigin-allow-in-http-header.php
new file mode 100644
index 0000000000000000000000000000000000000000..aaa2eecd3f22bf2917cac75b74511d1a656b1f3c
--- /dev/null
+++ b/LayoutTests/http/tests/security/suborigins/suborigin-allow-in-http-header.php
@@ -0,0 +1,26 @@
+<?php
+header("Content-Security-Policy: suborigin foobar");
+?>
+<!DOCTYPE html>
+<html>
+<head>
+<title>Allow suborigin in HTTP header</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<script>
+window.onmessage = function() {
+ var iframe = document.getElementById('iframe');
+ var secret = '';
+ try {
+ secret = iframe.contentWindow.secret;
+ assert_equals(secret, "I am a secret", "The parent frame should be able to get the secret value from the child iframe.");
+ done();
+ } catch(e) {
+ assert_unreached();
+ done();
+ };
+};
+</script>
+<iframe id="iframe" src="resources/childsuborigin.php?suborigin=foobar"></iframe>
+</html>

Powered by Google App Engine
This is Rietveld 408576698