mirror of
https://github.com/servo/servo.git
synced 2025-08-18 03:45:33 +01:00
Added exception-handling to worker wpt tests.
This commit is contained in:
parent
7d785e75cd
commit
030e01c1d1
5 changed files with 9 additions and 6 deletions
|
@ -4,6 +4,10 @@
|
|||
<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");
|
||||
|
||||
|
|
|
@ -25,7 +25,9 @@ function assert_worker_construction_fails(test_desc, mime_type, worker_code) {
|
|||
w.onmessage = t.step_func_done(function(e) {
|
||||
assert_unreached('Should not receive any message back.');
|
||||
});
|
||||
w.onerror = t.step_func_done(function() {
|
||||
w.onerror = t.step_func_done(function(e) {
|
||||
// Stop the error from being propagated to the WPT test harness
|
||||
e.preventDefault();
|
||||
});
|
||||
}, test_desc);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue