OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <meta http-equiv="Content-Security-Policy" content="sandbox allow-scripts al
low-popups allow-popups-to-escape-sandbox"> |
| 5 <script src="/resources/testharness.js"></script> |
| 6 <script src="/resources/testharnessreport.js"></script> |
| 7 </head> |
| 8 <body> |
| 9 <script> |
| 10 if (window.testRunner) { |
| 11 testRunner.setCanOpenWindows(); |
| 12 testRunner.setCloseRemainingWindowsWhenComplete(true); |
| 13 } |
| 14 |
| 15 var test = async_test("Testing that popups opened when 'allow-popups-to-
escape-sandbox' present can be navigated"); |
| 16 |
| 17 var current = 0; |
| 18 var win = null; |
| 19 |
| 20 window.addEventListener("message", test.step_func(function (e) { |
| 21 assert_equals(document.origin, 'null'); |
| 22 if (current == 0) { |
| 23 assert_equals(e.data.origin, 'http://127.0.0.1:8000'); |
| 24 current++; |
| 25 win.location.replace('http://localhost:8000/security/resources/p
ost-origin-to-opener.html'); |
| 26 } else { |
| 27 assert_equals(e.data.origin, 'http://localhost:8000'); |
| 28 test.done(); |
| 29 } |
| 30 })); |
| 31 |
| 32 test.step(function () { |
| 33 console.log("Opening a window!"); |
| 34 win = window.open('/security/resources/post-origin-to-opener.html',
'_blank', ''); |
| 35 }); |
| 36 </script> |
| 37 </body> |
| 38 </html> |
OLD | NEW |