OLD | NEW |
(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="resources/referrer-policy-sr
cdoc.php?test=srcdoc-within-srcdoc"></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="resources/referrer-policy-srcdoc.php?test=srcdoc-within-srcdoc-wi
th-own-policy"></script>'></iframe>"></iframe> |
| 56 |
| 57 </body> |
| 58 </html> |
OLD | NEW |