tor-browser

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

multiple-nested-events.tentative.html (1010B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4 <meta charset="utf-8">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <script src="/resources/testdriver.js"></script>
      8 <script src="/resources/testdriver-vendor.js"></script>
      9 <script src="resources/soft-navigation-helper.js"></script>
     10 </head>
     11 <body>
     12  <a id=link>Click me!</a>
     13  <main id=main></main>
     14  <script>
     15    testSoftNavigation({
     16      testName: "Test multiple nested navigate events",
     17      pushState: () => new Promise(resolve => {
     18        // navigate event fires synchronously, so we have to set up event
     19        // handler then call pushState.
     20        navigation.addEventListener("navigate", () => {
     21          navigation.addEventListener("navigate", () => {
     22            resolve();
     23          }, { once: true });
     24 
     25          history.pushState({}, '', 'two.html');
     26        }, { once: true });
     27 
     28        history.pushState({}, '', 'one.html');
     29      }),
     30      pushUrl: 'two.html',
     31    });
     32  </script>
     33 </body>
     34 </html>