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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-srcdoc.html

Issue 2400443004: Walk up frame tree for srcdoc referrer policies (Closed)
Patch Set: fix dynamic policy test Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-srcdoc-dynamic-policy.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-srcdoc.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-srcdoc.html b/third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-srcdoc.html
new file mode 100644
index 0000000000000000000000000000000000000000..b8cdcd5d4fca1135eb1991e82edbc8345660bd71
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-srcdoc.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <meta name="referrer" content="origin">
+ </head>
+ <body>
+ <script>
+ async_test(function () {
+ window.addEventListener("message", this.step_func(function (event) {
+ if (event.data.test == "parent-referrer-policy") {
+ assert_equals(document.location.origin + "/", event.data.referrer);
+ this.done();
+ }
+ }));
+ }, "srcdoc iframe uses parent's referrer policy");
+ </script>
+ <iframe srcdoc="<script src='resources/referrer-policy-srcdoc.php?test=parent-referrer-policy'></script>"></iframe>
+
+ <script>
+ async_test(function () {
+ window.addEventListener("message", this.step_func(function (event) {
+ if (event.data.test == "own-referrer-policy") {
+ assert_equals(document.location.href, event.data.referrer);
+ this.done();
+ }
+ }));
+ }, "srcdoc iframe can have its own referrer policy");
+ </script>
+ <iframe srcdoc="<meta name='referrer' content='unsafe-url'><script src='resources/referrer-policy-srcdoc.php?test=own-referrer-policy'></script>"></iframe>
+
+ <script>
+ async_test(function () {
+ window.addEventListener("message", this.step_func(function (event) {
+ if (event.data.test == "srcdoc-within-srcdoc") {
+ assert_equals(document.location.origin + "/", event.data.referrer);
+ this.done();
+ }
+ }));
+ }, "srcdoc iframe within srcdoc iframe uses root's referrer policy");
+ </script>
+ <iframe srcdoc="<iframe srcdoc='<script src=&quot;resources/referrer-policy-srcdoc.php?test=srcdoc-within-srcdoc&quot;></script>'></iframe>"></iframe>
+
+ <script>
+ async_test(function () {
+ window.addEventListener("message", this.step_func(function (event) {
+ if (event.data.test == "srcdoc-within-srcdoc-with-own-policy") {
+ assert_equals(document.location.href, event.data.referrer);
+ this.done();
+ }
+ }));
+ }, "srcdoc iframe within srcdoc iframe with its own policy");
+ </script>
+ <iframe srcdoc="<meta name='referrer' content='unsafe-url'><iframe srcdoc='<script src=&quot;resources/referrer-policy-srcdoc.php?test=srcdoc-within-srcdoc-with-own-policy&quot;></script>'></iframe>"></iframe>
+
+ </body>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/referrer-policy-srcdoc-dynamic-policy.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698