tor-browser

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

WorkerGlobalScope_setTimeout.htm (644B)


      1 <!DOCTYPE html>
      2 <title> WorkerGlobalScope API: setTimeout() </title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <div id=log></div>
      6 <script>
      7 async_test(function(t) {
      8  var result = [];
      9  var worker = new Worker('./support/Timer.js');
     10  worker.onmessage = t.step_func(function(e) {
     11    result.push(e.data);
     12    if (result.length == 3) {
     13      assert_array_equals(result, ["hello", "worker", "worker"]);
     14      worker.onmessage = t.unreached_func('Unexpected message event');
     15      setTimeout(t.step_func_done(), 100);
     16    }
     17  });
     18  worker.postMessage("TimeoutHandler");
     19 });
     20 </script>