tor-browser

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

link-upgrade.sub.https.html (2039B)


      1 <!DOCTYPE html>
      2 <html>
      3 
      4  <head>
      5    <meta name="timeout" content="long">
      6    <script src="/resources/testharness.js"></script>
      7    <script src="/resources/testharnessreport.js"></script>
      8  </head>
      9 
     10  <body>
     11    <script>
     12      const test_data = [
     13        {
     14          url : './link-upgrade/basic-link-no-upgrade.sub.html',
     15          done_message : 'basic-link-no-upgrade',
     16        },
     17        {
     18          url : './link-upgrade/basic-link-upgrade.sub.html',
     19          done_message : 'basic-link-upgrade',
     20        },
     21        {
     22          url : './link-upgrade/iframe-link-upgrade.sub.html',
     23          done_message : 'iframe-link-upgrade',
     24        },
     25        {
     26          url : './link-upgrade/iframe-top-navigation-no-upgrade-1.sub.html',
     27          done_message : 'iframe-top-navigation-no-upgrade-1',
     28        },
     29        {
     30          url : './link-upgrade/iframe-top-navigation-no-upgrade-2.sub.html',
     31          done_message : 'iframe-top-navigation-no-upgrade-2',
     32        },
     33        {
     34          url : './link-upgrade/iframe-top-navigation-upgrade-1.sub.html',
     35          done_message : 'iframe-top-navigation-upgrade-1',
     36        },
     37        {
     38          url : './link-upgrade/iframe-top-navigation-upgrade-2.sub.html',
     39          done_message : 'iframe-top-navigation-upgrade-2',
     40        },
     41        {
     42          url : './link-upgrade/iframe-top-navigation-upgrade-meta.sub.html',
     43          done_message : 'iframe-top-navigation-upgrade-meta',
     44        },
     45      ];
     46      for(let i = 0; i<test_data.length; i+=1) {
     47        let data = test_data[i];
     48        let test = async_test(data.url);
     49        test.step(function() {
     50          let w = window.open(data.url, data.url);
     51          this.add_cleanup(() => w.close());
     52          assert_true(w != undefined, "Popup must not be blocked");
     53 
     54          window.addEventListener("message", event => {
     55            if (event.data == data.done_message)
     56              test.done();
     57          });
     58        });
     59 
     60        test.step_timeout(function(){test.force_timeout()}, 10000);
     61      }
     62    </script>
     63  </body>
     64 
     65 </html>