https://github.com/web-platform-tests/wpt
Raw File
Tip revision: caabb339c4b96dfc4a9e42a40c118e5df7ccd070 authored by Tarun Bansal on 07 May 2018, 19:22:03 UTC
Add client hints headers as CORS safe headers
Tip revision: caabb33
WorkerGlobalScope_ErrorEvent_filename.htm
<!DOCTYPE html>
<title> WorkerGlobalScope onerror event handler argument: location </title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id=log></div>
<script>
// The worker events races with the window's load event; if the worker events
// arrive first, the harness will detect the error event and fail the test.
setup({ allow_uncaught_exception: true });

async_test(function(t) {
  var worker = new Worker('./support/ErrorEvent.js');
  worker.onmessage = t.step_func_done(function(e) {
    var href = location.href;
    var expected = href.substring(0, href.lastIndexOf('/')) + '/support/ErrorEvent.js';
    assert_equals(e.data.filename, expected);
  });
  worker.postMessage("Error Message");
});
</script>
back to top