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-1.html
1 <!DOCTYPE html>
2 <html>
3   <head>
4     <meta charset="utf-8">
5     <title>Check that sandboxed iframe can perform navigation on the top frame
6            when allow-top-navigation is set</title>
7     <script src="/resources/testharness.js"></script>
8     <script src="/resources/testharnessreport.js"></script>
9   </head>
10   <body>
11     <iframe sandbox="allow-top-navigation allow-scripts"></iframe>
12     <script>
13       // We are the main test page.  Open a popup, so that we can
14       // can experiment navigation of the top frame.
15       async_test(t => {
16         window.addEventListener("message", t.step_func_done(e => {
17           assert_equals(e.data, "can navigate");
18           e.source.close();
19         }));
20         window.open("support/load-into-the-iframe.html");
21       }, "Frames with `allow-top-navigation` should be able to navigate the top frame.");
22     </script>
23   </body>
24 </html>