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

Unified Diff: LayoutTests/http/tests/security/contentSecurityPolicy/suborigin-blocked-in-http-header.html

Issue 27073003: CSP Suborigins Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address abarth's comments Created 6 years, 2 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-blocked-in-http-header.html
diff --git a/LayoutTests/http/tests/security/contentSecurityPolicy/suborigin-blocked-in-http-header.html b/LayoutTests/http/tests/security/contentSecurityPolicy/suborigin-blocked-in-http-header.html
new file mode 100644
index 0000000000000000000000000000000000000000..8647aa00fa196c03a107ef68cadd238f74e7ef25
--- /dev/null
+++ b/LayoutTests/http/tests/security/contentSecurityPolicy/suborigin-blocked-in-http-header.html
@@ -0,0 +1,21 @@
+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+
+function iframeLoaded() {
+ var iframe = document.getElementById('iframe');
+ try {
+ var secret = iframe.contentWindow.secret;
+ alert("FAIL: Secret is '" + secret + "'.");
+ } catch(e) {
+ alert('PASS: Prevented from accessing the content of the iframe in a different suborigin.');
+ }
+ testRunner.notifyDone();
+}
+</script>
+<p>
+This tests whether a frame is prevented from accessing secrets in a frame in a different suborigin.
+</p>
+<iframe onload="iframeLoaded();" id="iframe" src="resources/suborigin.php?suborigin=foobar"></iframe>
Mike West 2014/10/23 12:59:18 As a general note, I'd suggest postMessaging the f
jww 2015/03/20 22:50:02 Done.

Powered by Google App Engine
This is Rietveld 408576698