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

Unified Diff: LayoutTests/http/tests/security/contentSecurityPolicy/suborigin-allow.html

Issue 27073003: CSP Suborigins Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 6 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/contentSecurityPolicy/suborigin-allow.html
diff --git a/LayoutTests/http/tests/security/contentSecurityPolicy/suborigin-allow.html b/LayoutTests/http/tests/security/contentSecurityPolicy/suborigin-allow.html
new file mode 100644
index 0000000000000000000000000000000000000000..bf5c2839cf9a58eb5f233a9eed8e8ae22998529e
--- /dev/null
+++ b/LayoutTests/http/tests/security/contentSecurityPolicy/suborigin-allow.html
@@ -0,0 +1,22 @@
+<meta http-equiv="Content-Security-Policy" content="suborigin foobar">
abarth-chromium 2014/07/31 05:02:05 I don't understand how this works. Does this mean
jww 2014/10/21 23:51:06 I 100% agree. I should have mentioned this in my o
+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+
+function iframeLoaded() {
+ var iframe = document.getElementById('iframe');
+ try {
+ var secret = iframe.contentWindow.secret;
+ alert("PASS: Secret is '" + secret + "'.");
+ } catch(e) {
+ alert('FAIL: Prevented from accessing the content of the iframe in the same suborigin.');
+ }
+ testRunner.notifyDone();
+}
+</script>
+<p>
+This tests whether a frame in a can access secrets in a frame in the same suborigin.
+</p>
+<iframe onload="iframeLoaded();" id="iframe" src="resources/suborigin-frame.html"></iframe>

Powered by Google App Engine
This is Rietveld 408576698