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

Unified Diff: LayoutTests/http/tests/security/suborigins/resources/iframe-reaches-into-parent.php

Issue 1180923003: Add window access checks for Suborigins (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix tests on Windows Created 5 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/suborigins/resources/iframe-reaches-into-parent.php
diff --git a/LayoutTests/http/tests/security/suborigins/resources/iframe-reaches-into-parent.php b/LayoutTests/http/tests/security/suborigins/resources/iframe-reaches-into-parent.php
new file mode 100644
index 0000000000000000000000000000000000000000..22b5cac219bf8c25d41f297bd15985f18d155f35
--- /dev/null
+++ b/LayoutTests/http/tests/security/suborigins/resources/iframe-reaches-into-parent.php
@@ -0,0 +1,21 @@
+<?php
+if ($_GET["suborigin"]) {
+ header("Content-Security-Policy: suborigin " . $_GET["suborigin"]);
+}
+?>
+<!DOCTYPE html>
+<html>
+<script>
+window.secret = '';
+window.onmessage = function() {
+ window.parent.postMessage(secret, '*');
+};
+</script>
+<?php
+if ($_GET["childsuborigin"]) {
+ echo "<iframe id=\"iframe\" src=\"post-to-parent.php?suborigin=" . $_GET["childsuborigin"] . "\"></iframe>";
+} else {
+ echo "<iframe id=\"iframe\" src=\"post-to-parent.php\"></iframe>";
+}
+?>
+</html>

Powered by Google App Engine
This is Rietveld 408576698