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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 <meta name="referrer" content="origin">
7 </head>
8 <body>
9 <script>
10 async_test(function () {
11 window.addEventListener("message", this.step_func(function (event) {
12 if (event.data.test == "parent-referrer-policy") {
13 assert_equals(document.location.origin + "/", event.data.referrer);
14 this.done();
15 }
16 }));
17 }, "srcdoc iframe uses parent's referrer policy");
18 </script>
19 <iframe srcdoc="<script src='resources/referrer-policy-srcdoc.php?test=parent- referrer-policy'></script>"></iframe>
20
21 <script>
22 async_test(function () {
23 window.addEventListener("message", this.step_func(function (event) {
24 if (event.data.test == "own-referrer-policy") {
25 assert_equals(document.location.href, event.data.referrer);
26 this.done();
27 }
28 }));
29 }, "srcdoc iframe can have its own referrer policy");
30 </script>
31 <iframe srcdoc="<meta name='referrer' content='unsafe-url'><script src='resour ces/referrer-policy-srcdoc.php?test=own-referrer-policy'></script>"></iframe>
32
33 <script>
34 async_test(function () {
35 window.addEventListener("message", this.step_func(function (event) {
36 if (event.data.test == "srcdoc-within-srcdoc") {
37 assert_equals(document.location.origin + "/", event.data.referrer);
38 this.done();
39 }
40 }));
41 }, "srcdoc iframe within srcdoc iframe uses root's referrer policy");
42 </script>
43 <iframe srcdoc="<iframe srcdoc='<script src=&quot;resources/referrer-policy-sr cdoc.php?test=srcdoc-within-srcdoc&quot;></script>'></iframe>"></iframe>
44
45 <script>
46 async_test(function () {
47 window.addEventListener("message", this.step_func(function (event) {
48 if (event.data.test == "srcdoc-within-srcdoc-with-own-policy") {
49 assert_equals(document.location.href, event.data.referrer);
50 this.done();
51 }
52 }));
53 }, "srcdoc iframe within srcdoc iframe with its own policy");
54 </script>
55 <iframe srcdoc="<meta name='referrer' content='unsafe-url'><iframe srcdoc='<sc ript src=&quot;resources/referrer-policy-srcdoc.php?test=srcdoc-within-srcdoc-wi th-own-policy&quot;></script>'></iframe>"></iframe>
56
57 </body>
58 </html>
OLDNEW
« 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