tor-browser

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

test_timeoutTracing.html (1187B)


      1 <!--
      2  Any copyright is dedicated to the Public Domain.
      3  http://creativecommons.org/publicdomain/zero/1.0/
      4 -->
      5 <!DOCTYPE HTML>
      6 <html>
      7 <!--
      8 Tests of DOM Worker Threads
      9 -->
     10 <head>
     11  <title>Test for DOM Worker Threads</title>
     12  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     13  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     14 </head>
     15 <body>
     16 <pre id="test">
     17 <script class="testbody" type="text/javascript">
     18 
     19  var worker = new Worker("timeoutTracing_worker.js");
     20 
     21  worker.onmessage = function(event) {
     22    // begin
     23    worker.onmessage = null;
     24 
     25    // 1 second should be enough to crash.
     26    window.setTimeout(function() {
     27      ok(true, "Didn't crash!");
     28      SimpleTest.finish();
     29    }, 1000);
     30 
     31    var os = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
     32                          .getService(SpecialPowers.Ci.nsIObserverService);
     33    os.notifyObservers(null, "memory-pressure", "heap-minimize");
     34  }
     35 
     36  worker.onerror = function(event) {
     37    ok(false, "I was expecting a crash, not an error");
     38    SimpleTest.finish();
     39  };
     40 
     41  SimpleTest.waitForExplicitFinish();
     42  SimpleTest.requestFlakyTimeout("untriaged");
     43 
     44 </script>
     45 </pre>
     46 </body>
     47 </html>