tor-browser

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

test_bug581072.html (1150B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=581072
      5 -->
      6 <head>
      7  <title>Test for Bug 581072</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     10 </head>
     11 <body>
     12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=581072">Mozilla Bug 581072</a>
     13 <p id="display"></p>
     14 <div id="content" style="display: none">
     15  
     16 </div>
     17 <pre id="test">
     18 <script type="application/javascript">
     19 
     20 SimpleTest.waitForExplicitFinish();
     21 SimpleTest.requestFlakyTimeout("untriaged");
     22 
     23 /** Test for Bug 581072 */
     24 var longTimerFired = false;
     25 
     26 // Set up a one-hour timeout
     27 setTimeout(function() { longTimerFired = true; }, 3600000);
     28 
     29 // Trigger suspend and resume timeouts
     30 (function() {
     31  var utils = SpecialPowers.getDOMWindowUtils(window);
     32  utils.suspendTimeouts();  
     33  utils.resumeTimeouts();  
     34 })()
     35 
     36 // Now set up another timeout which should fire before the one-hour one
     37 setTimeout(function() {
     38  is(longTimerFired, false, "One-hour timer should not fire before our 0ms one");
     39  SimpleTest.finish();
     40 }, 0);
     41 
     42 
     43 
     44 </script>
     45 </pre>
     46 </body>
     47 </html>