tor-browser

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

SharedWorker-exception.html (883B)


      1 <!DOCTYPE html>
      2 <title>This test checks whether exceptions in SharedWorkers are logged to the parent document. An exception should be logged to the error console.</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="support/SharedWorker-create-common.js"></script>
      6 <script>
      7 // Ignore any error event fired on window in this test. This is tested
      8 // separately in SharedWorker-exception-propagation.html.
      9 setup({ allow_uncaught_exception: true });
     10 
     11 async_test(function(t) {
     12    var worker = createWorker();
     13    worker.postMessage("throw");
     14    worker.postMessage("ping");
     15    worker.onmessage = function(evt) {
     16        // Wait for response from ping - that's how we know we have thrown the exception.
     17        if (evt.data == "PASS: Received ping message") {
     18            t.done();
     19        }
     20    };
     21 });
     22 </script>