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-3.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 (even when
7            allow-top-navigation-by-user-activation is set)</title>
8     <script src="/resources/testharness.js"></script>
9     <script src="/resources/testharnessreport.js"></script>
10   </head>
11   <body>
12     <!-- Specifying both allow-top-navigation and
13          allow-top-navigation-by-user-activation is a document conformance
14          error: allow-top-navigation-by-user-activation will have no effect. -->
15     <iframe sandbox="allow-top-navigation allow-top-navigation-by-user-activation allow-scripts"></iframe>
16     <script>
17       // We are the main test page.  Open a popup, so that we can
18       // can experiment navigation of the top frame.
19       async_test(t => {
20         window.addEventListener("message", t.step_func_done(e => {
21           assert_equals(e.data, "can navigate");
22           e.source.close();
23         }));
24         window.open("support/load-into-the-iframe.html");
25       }, "Frames with `allow-top-navigation` should be able to navigate the top frame even when `allow-top-navigation-by-user-activation` is set.");
26     </script>
27   </body>
28 </html>