Skip to content

Commit

Permalink
Added exception-handling to worker wpt tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Jeffrey committed Jun 22, 2017
1 parent 7d785e7 commit 030e01c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/wpt/metadata/MANIFEST.json
Expand Up @@ -615810,7 +615810,7 @@
"testharness"
],
"workers/Worker_ErrorEvent_error.htm": [
"975ca8b575fb2f616623b810696287513b164d2d",
"43f1cd277819f57c7708690ff3a91dde8b2a3af5",
"testharness"
],
"workers/Worker_ErrorEvent_filename.htm": [
Expand Down Expand Up @@ -616102,7 +616102,7 @@
"testharness"
],
"workers/data-url.html": [
"50abaf936cfb58ba14e6870c9b7f239f5d54f59c",
"a9084f9a3b6fc31d54b564b80869826f132f1166",
"testharness"
],
"workers/interfaces.idl": [
Expand Down
2 changes: 0 additions & 2 deletions tests/wpt/metadata/workers/Worker_ErrorEvent_error.htm.ini

This file was deleted.

1 change: 0 additions & 1 deletion tests/wpt/metadata/workers/data-url.html.ini
@@ -1,6 +1,5 @@
[data-url.html]
type: testharness
expected: ERROR
[worker has opaque origin]
expected: FAIL

Expand Up @@ -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");

Expand Down
4 changes: 3 additions & 1 deletion tests/wpt/web-platform-tests/workers/data-url.html
Expand Up @@ -25,7 +25,9 @@
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);
}
Expand Down

0 comments on commit 030e01c

Please sign in to comment.