OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
| 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> |
3 <script> | 5 <script> |
4 if (window.testRunner) | 6 var test = async_test("Sandboxed frame cannot navigate top-level browsing co
ntext by name."); |
5 testRunner.dumpAsText(); | 7 |
6 window.name = "target" | 8 window.addEventListener("message", test.step_func(function (e) { |
| 9 assert_equals(undefined, e.data["target"]); |
| 10 assert_equals(undefined, e.data["_top"]); |
| 11 assert_equals(undefined, e.data["_parent"]); |
| 12 assert_equals(undefined, e.data["_blank"]); |
| 13 |
| 14 test.done(); |
| 15 })); |
7 </script> | 16 </script> |
8 </head> | 17 </head> |
9 <body> | 18 <body> |
10 <p>This test verifies that a sandboxed IFrame cannot navigate the top-level | |
11 frame without allow-top-navigation. This test passes if the navigation does | |
12 not occur.</p> | |
13 <iframe sandbox="allow-scripts" | 19 <iframe sandbox="allow-scripts" |
14 src="resources/navigate-top-by-name-to-fail.html"> | 20 srcdoc=" |
| 21 <script> |
| 22 window.top.postMessage({ |
| 23 'target': window.open('fail-and-notify-done.html', 'target'), |
| 24 '_top': window.open('fail-and-notify-done.html', '_top'), |
| 25 '_parent': window.open('fail-and-notify-done.html', '_parent'), |
| 26 '_blank': window.open('fail-and-notify-done.html', '_blank'), |
| 27 }, '*'); |
| 28 </script> |
| 29 "> |
15 </body> | 30 </body> |
16 </html> | 31 </html> |
OLD | NEW |