tor-browser

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

004.html (933B)


      1 <!doctype html>
      2 <title>shared worker in two documents and window.onerror</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <div id=log></div>
      6 <script>
      7 setup({allow_uncaught_exception:true});
      8 var t = async_test(function() {
      9  window.onerror = this.step_func(function(a) {
     10    assert_unreached('(outer) window.onerror invoked: ' + a);
     11  });
     12  var worker = new SharedWorker('004.js', '');
     13  worker.addEventListener('error', this.step_func(function(e) {
     14    assert_unreached('(outer) error on worker');
     15  }), false);
     16  worker.port.addEventListener('error', this.step_func(function(e) {
     17    assert_unreached('(outer) error on port');
     18  }), false);
     19  worker.port.onmessage = this.step_func(function(e) {
     20    assert_equals(e.data, 1);
     21    var iframe = document.createElement('iframe');
     22    iframe.src = '004-1.html';
     23    document.body.appendChild(iframe);
     24  });
     25 });
     26 </script>