Update WPT tests for embedded content
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / html / semantics / embedded-content / the-iframe-element / iframe_sandbox_allow_top_navigation-2.html
1 <!DOCTYPE html>
2 <html>
3   <head>
4     <meta charset="utf-8">
5     <title>Check that sandboxed iframe cannot perform navigation on the top
6            frame when allow-top-navigation is not set</title>
7     <script src="/resources/testharness.js"></script>
8     <script src="/resources/testharnessreport.js"></script>
9   </head>
10   <body>
11     <script>
12       // We are the main test page.  Open a popup, so that we can
13       // can experiment navigation of the top frame.
14       async_test(t => {
15         window.addEventListener("message", t.step_func_done(e => {
16           assert_equals(e.data, "cannot navigate");
17           e.source.close();
18         }));
19         window.open('support/load-into-the-iframe.html');
20       }, "Frames without `allow-top-navigation` should not be able to navigate the top frame.");
21     </script>
22   </body>
23 </html>