tor-browser

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

test_performance_user_timing.html (2071B)


      1 <!DOCTYPE HTML>
      2 <html>
      3    <!--
      4              https://bugzilla.mozilla.org/show_bug.cgi?id=782751
      5              -->
      6    <head>
      7        <title>Test for Bug 782751</title>
      8        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      9        <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10        <script type="text/javascript" src="test_performance_user_timing.js"></script>
     11    </head>
     12    <body>
     13        <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=782751">Mozilla Bug 782751 - User Timing API</a>
     14        <div id="content">
     15        </div>
     16        <pre id="test">
     17            <script class="testbody" type="text/javascript">
     18             var index = 0;
     19 
     20             function next() {
     21                 ok(true, "Begin!");
     22                 var arr;
     23                 for (var i = 0; i < steps.length; ++i) {
     24                     try {
     25                         performance.clearMarks();
     26                         performance.clearMeasures();
     27                         performance.clearResourceTimings();
     28                         is(performance.getEntriesByType("resource").length, 0, "clearing performance resource entries");
     29                         is(performance.getEntriesByType("mark").length, 0, "clearing performance mark entries");
     30                         is(performance.getEntriesByType("measure").length, 0, "clearing performance measure entries");
     31                         steps[i]();
     32                     } catch(ex) {
     33                         ok(false, "Caught exception", ex);
     34                     }
     35                 }
     36 
     37                SpecialPowers.setBoolPref("privacy.reduceTimerPrecision", reduceTimePrecisionPrevPrefValue);
     38                SimpleTest.finish();
     39             }
     40 
     41             var reduceTimePrecisionPrevPrefValue = SpecialPowers.getBoolPref("privacy.reduceTimerPrecision");
     42             SpecialPowers.setBoolPref("privacy.reduceTimerPrecision", false);
     43 
     44             SimpleTest.waitForExplicitFinish();
     45             addLoadEvent(next);
     46            </script>
     47        </pre>
     48    </body>
     49 </html>