Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
            
- /workers/interfaces/WorkerGlobalScope/onerror/handled.html - WPT Dashboard Interop Dashboard
 
 
<!doctype html>
<title>onerror, "handled"</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function() {
  var worker = new Worker('handled.js');
  worker.onmessage = this.step_func(function(e) {
    assert_equals(typeof e.data[0], 'string', 'first argument');
    assert_equals(e.data[1], document.URL.replace('.html', '.js'), 'second argument');
    assert_equals(typeof e.data[2], 'number', 'third argument');
    assert_equals(typeof e.data[3], 'number', 'fourth argument');
    setTimeout(this.step_func(function() {
      this.done();
    }), 100);
  });
  worker.onerror = this.step_func(function(e) {
    assert_unreached();
  });
});
</script>