OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <meta http-equiv="Content-Security-Policy" content="sandbox allow-scripts al
low-popups"> |
| 5 <script src="/resources/testharness.js"></script> |
| 6 <script src="/resources/testharnessreport.js"></script> |
| 7 </head> |
| 8 <body> |
| 9 <a target='_blank' href='/security/resources/post-origin-to-opener.html'></a
> |
| 10 <script> |
| 11 if (window.testRunner) { |
| 12 testRunner.setCanOpenWindows(); |
| 13 testRunner.setCloseRemainingWindowsWhenComplete(true); |
| 14 } |
| 15 |
| 16 var test = async_test("Testing sandbox inherited via target='_blank'"); |
| 17 |
| 18 window.addEventListener("message", test.step_func(function (e) { |
| 19 assert_equals(document.origin, 'null'); |
| 20 assert_equals(e.data.origin, 'null'); |
| 21 test.done(); |
| 22 })); |
| 23 |
| 24 test.step(function () { |
| 25 var link = document.querySelector('a'); |
| 26 link.click(); |
| 27 }); |
| 28 </script> |
| 29 </body> |
| 30 </html> |
OLD | NEW |