tor-browser

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

test_bug691547.html (2159B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=691547
      5 -->
      6 <head>
      7  <title>Test for Bug 691547</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     10  <script type="application/javascript">
     11     var navStart = 0;
     12     var beforeReload = 0;
     13     function onContentLoad() {
     14       var frame = frames[0];
     15       if (!navStart) {
     16         // First time we perform navigation in subframe. The bug is that
     17         // load in subframe causes timing.navigationStart to be recorded
     18         // as if it was a start of the next navigation.
     19         var innerFrame = frame.frames[0];
     20         navStart = frame.performance.timing.navigationStart;
     21         innerFrame.location = "bug570341_recordevents.html";
     22         // Let's wait a bit so the difference is clear anough.
     23         setTimeout(reload, 3000);
     24       } else {
     25         // Content reloaded, time to check. We are allowing a huge time slack,
     26         // in case clock is imprecise. If we have a bug, the difference is
     27         // expected to be about the timeout value set above.
     28         var diff = frame.performance.timing.navigationStart - beforeReload;
     29         ok(diff >= -200,
     30            "navigationStart should be set after reload request. " +
     31            "Measured difference: " + diff + " (should be positive)");
     32         SimpleTest.finish();
     33       }
     34     }
     35     function reload() {
     36       var frame = frames[0];
     37       ok(navStart == frame.performance.timing.navigationStart,
     38          "navigationStart should not change when frame loads.");
     39       beforeReload = Date.now();
     40       frame.location.reload();
     41     }
     42  </script>
     43 </head>
     44 <body>
     45 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=570341">Mozilla Bug 570341</a>
     46 <div id="frames">
     47 <iframe name="frame0" id="frame0" src="bug691547_frame.html" onload="onContentLoad()"></iframe>
     48 </div>
     49 <div id="content" style="display: none">
     50 
     51 </div>
     52 <pre id="test">
     53 <script type="application/javascript">
     54 SimpleTest.waitForExplicitFinish();
     55 SimpleTest.requestFlakyTimeout("untriaged");
     56 </script>
     57 </pre>
     58 </body>
     59 </html>