tor-browser

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

test_fetchedModuleHasErrorToRethrow.html (720B)


      1 <!DOCTYPE html>
      2 <meta charset=utf-8>
      3 <title>Test an imported module has an error to rethrow</title>
      4 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
      5 <script>
      6  SimpleTest.waitForExplicitFinish();
      7 
      8  let count = 0;
      9  let hasErrorToRethrow = false;
     10  window.onerror = (e) => {
     11    hasErrorToRethrow = true;
     12    count++;
     13  };
     14 
     15  function testLoaded() {
     16    is(hasErrorToRethrow, true, "hasErrorToRethrow should be set to true");
     17    is(count, 2, "window.onerror should be called twice");
     18    SimpleTest.finish();
     19  }
     20 </script>
     21 <script type="module" src="./import_parse_error.mjs"></script>
     22 <script type="module" src="./import_parse_error_1.mjs"></script>
     23 <body onload='testLoaded()'></body>