Revision 614c1ccac5f885e58444fe74a2aedd120d2ca73f authored by Marcos Cáceres on 21 August 2018, 05:04:44 UTC, committed by GitHub on 21 August 2018, 05:04:44 UTC
1 parent 4797b9c
Worker_ErrorEvent_error.htm
<!doctype html>
<meta charset=utf-8>
<title></title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<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 });
var t1 = async_test("Error handler outside the worker should not see the error value");
var t2 = async_test("Error handlers inside a worker should see the error value");
test(function() {
var worker = new Worker("support/ErrorEvent-error.js");
worker.onerror = t1.step_func_done(function(e) {
assert_true(/hello/.test(e.message));
assert_equals(e.error, null);
});
var messages = 0;
worker.onmessage = t2.step_func(function(e) {
++messages;
var data = e.data;
assert_in_array(data.source, ["onerror", "event listener"]);
assert_equals(data.value, "hello");
if (messages == 2) {
t2.done();
}
});
});
</script>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...