tor-browser

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

file_bug462076_1.html (1398B)


      1 <html>
      2  <head>
      3    <title>Bug 462076</title>
      4    <script>
      5      var srcs = [ "frame0.html",
      6                   "frame1.html",
      7                   "frame2.html",
      8                   "frame3.html" ];
      9 
     10      var checkCount = 0;
     11 
     12      function makeFrame(index) {
     13        var ifr = document.createElement("iframe");
     14        ifr.src = srcs[index];
     15        ifr.onload = checkFrame;
     16        document.getElementById("container" + index).appendChild(ifr);
     17      }
     18 
     19      function runTest() {
     20        var randomNumber = Math.floor(Math.random() * 4);
     21        for (var i = randomNumber; i < 4; ++i) {
     22          makeFrame(i);
     23        }
     24        for (var k = 0; k < randomNumber; ++k) {
     25          makeFrame(k);
     26        }
     27      }
     28 
     29      function checkFrame(evt) {
     30        var ifr = evt.target;
     31        opener.ok(String(ifr.contentWindow.location).includes(ifr.src),
     32           "Wrong document loaded (" + ifr.src + ", " +
     33           ifr.contentWindow.location + ")!");
     34 
     35        if (++checkCount == 4) {
     36          if (++opener.testCount == 10) {
     37            opener.nextTest();
     38            window.close();
     39          } else {
     40            window.location.reload();
     41          }
     42        }
     43      }
     44    </script>
     45  </head>
     46  <body>
     47    <div id="container0"></div>
     48    <div id="container1"></div>
     49    <div id="container2"></div>
     50    <div id="container3"></div>
     51    <script>
     52      runTest();
     53    </script>
     54  </body>
     55 </html>