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

Unified Diff: LayoutTests/http/tests/security/suborigins/resources/child-changes-document-domain.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/child-changes-document-domain.php
diff --git a/LayoutTests/http/tests/security/suborigins/resources/child-changes-document-domain.php b/LayoutTests/http/tests/security/suborigins/resources/child-changes-document-domain.php
index b5f00298d7a16fab97db29c08f3a57166e5aa26e..f57d3fb615e58fe38a77f00d6e237d04a316395d 100644
--- a/LayoutTests/http/tests/security/suborigins/resources/child-changes-document-domain.php
+++ b/LayoutTests/http/tests/security/suborigins/resources/child-changes-document-domain.php
@@ -1,13 +1,16 @@
<?php
-if ($_GET["report-only"]) {
- header("Content-Security-Policy-Report-Only: suborigin " . $_GET["suborigin"]);
-} else {
+if ($_GET["suborigin"]) {
header("Content-Security-Policy: suborigin " . $_GET["suborigin"]);
}
?>
<!DOCTYPE html>
<script>
-document.domain = '127.0.0.1';
-window.parent.secret = 'I am a secret';
+try {
+ document.domain = '127.0.0.1';
+ window.parent.secret = 'I am a secret';
+} catch (e) {
+ parent.postMessage('' + e, '*');
+}
+
parent.postMessage('Done', '*');
</script>

Powered by Google App Engine
This is Rietveld 408576698