tor-browser

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

mediasource-worker-play-terminate-worker.js (737B)


      1 // This worker script is intended to be used by the
      2 // mediasource-worker-play-terminate-worker.html test case. The script import
      3 // may itself be terminated by the main thread terminating our context,
      4 // producing a NetworkError, so we catch and ignore a NetworkError here. Note
      5 // that any dependency on globals defined in the imported scripts may result in
      6 // test harness error flakiness if an undefined variable (due to termination
      7 // causing importScripts to fail) is accessed. Hence this script just imports
      8 // and handles import errors, since such nondeterministic worker termination is
      9 // central to the test case.
     10 try {
     11  importScripts("mediasource-worker-play.js");
     12 } catch(e) {
     13  if (e.name != "NetworkError")
     14    throw e;
     15 }