Index: LayoutTests/http/tests/security/contentSecurityPolicy/suborigin-blocked.html |
diff --git a/LayoutTests/http/tests/security/contentSecurityPolicy/suborigin-blocked.html b/LayoutTests/http/tests/security/contentSecurityPolicy/suborigin-blocked.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5fa6efc0e9ad280297567b04542aaa1ab3360ce5 |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/contentSecurityPolicy/suborigin-blocked.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-frame.html"></iframe> |