tor-browser

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

WorkerGlobalScope_ErrorEvent_filename.htm (778B)


      1 <!DOCTYPE html>
      2 <title> WorkerGlobalScope onerror event handler argument: location </title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <div id=log></div>
      6 <script>
      7 // The worker events races with the window's load event; if the worker events
      8 // arrive first, the harness will detect the error event and fail the test.
      9 setup({ allow_uncaught_exception: true });
     10 
     11 async_test(function(t) {
     12  var worker = new Worker('./support/ErrorEvent.js');
     13  worker.onmessage = t.step_func_done(function(e) {
     14    var href = location.href;
     15    var expected = href.substring(0, href.lastIndexOf('/')) + '/support/ErrorEvent.js';
     16    assert_equals(e.data.filename, expected);
     17  });
     18  worker.postMessage("Error Message");
     19 });
     20 </script>