chromium/third_party/blink/web_tests/external/wpt/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation-2.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Check that sandboxed iframe cannot perform navigation on the top
           frame when allow-top-navigation is not set</title>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
  </head>
  <body>
    <script>
      // We are the main test page.  Open a popup, so that we can
      // can experiment navigation of the top frame.
      async_test(t => {
        window.addEventListener("message", t.step_func_done(e => {
          assert_equals(e.data, "cannot navigate");
          e.source.close();
        }));
        window.open('support/load-into-the-iframe.html');
      }, "Frames without `allow-top-navigation` should not be able to navigate the top frame.");
    </script>
  </body>
</html>