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

Unified Diff: LayoutTests/http/tests/security/suborigins/suborigin-allow-same-suborigin-access.html

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/suborigin-allow-same-suborigin-access.html
diff --git a/LayoutTests/http/tests/security/suborigins/suborigin-allow-same-suborigin-access.html b/LayoutTests/http/tests/security/suborigins/suborigin-allow-same-suborigin-access.html
new file mode 100644
index 0000000000000000000000000000000000000000..29029c3c338627cb4d0b07a755e2b8bb0e0d9519
--- /dev/null
+++ b/LayoutTests/http/tests/security/suborigins/suborigin-allow-same-suborigin-access.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Allow suborigin in HTTP header</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<script>
+
+var tests;
+var nextTest = function() {
+ var test = tests.shift();
+ if (test)
+ test();
+}
+
+tests = [
+ function() {
+ async_test(function(t) {
+ window.onmessage = t.step_func(function(event) {
+ assert_equals(event.data, 'I am a secret');
+ t.done();
+ nextTest();
+ });
+ var iframe = document.createElement('iframe');
+ iframe.src = "resources/iframe-reaches-into-parent.php?suborigin=foobar&childsuborigin=foobar";
+ document.body.appendChild(iframe);
+ }, 'iframe reaches into parent')
+ },
+ function() {
+ async_test(function(t) {
+ window.onmessage = t.step_func(function(event) {
+ assert_equals(event.data, 'I am a secret');
+ t.done();
+ nextTest();
+ });
+ var iframe = document.createElement('iframe');
+ iframe.src = "resources/reach-into-iframe.php?suborigin=foobar&childsuborigin=foobar";
+ document.body.appendChild(iframe);
+ }, 'Parent reaches into iframe')
+ }
+];
+
+nextTest();
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698