tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

navigate-child.html (1138B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4 <meta charset="utf-8">
      5 <title>Navigate a child window.</title>
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script src="/resources/testdriver.js"></script>
      9 <script src="/resources/testdriver-vendor.js"></script>
     10 <script src="resources/soft-navigation-helper.js"></script>
     11 </head>
     12 <body>
     13  <main id=main>
     14  <a href="empty.html?2" rel=opener target=child id=link>Click me!</a>
     15  </main>
     16  <script>
     17    const child = window.open("resources/empty.html?1", "child");
     18 
     19    testSoftNavigation({
     20      testName: "Test that a navigated child window doesn't crash",
     21      extraSetup: async () => {
     22        while (!child.document) {
     23          await new Promise(r => t.step_timeout(r, 10));
     24        }
     25      },
     26      // No-op for the main page, so we don't navigate it
     27      dontExpectSoftNavs: true,
     28      pushState: () => {},
     29      addContent: () => {},
     30      extraValidations: async (t) => {
     31        while (!child.location.href.includes("2")) {
     32          await new Promise(r => t.step_timeout(r, 10));
     33        }
     34      }
     35    });
     36  </script>
     37 </body>
     38 </html>