Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[unhandled-rejection-following-subtest.html]
expected: ERROR
expected:
if product == "chrome": OK # https://github.com/web-platform-tests/wpt/pull/20329
ERROR

[Unhandled rejection following subtest]
expected: PASS
Expand Down
14 changes: 14 additions & 0 deletions infrastructure/testharness.js/uncaught-error-after-completion.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<meta charset=utf-8>
<title>Uncaught error immediately following completion</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<p>Uncaught errors following completion should not influence harness status.</p>
<script>
setup({explicit_done: true});
onload = function() {
test(() => {}, 'empty test');
done();
throw new Error('this is an uncaught error');
};
</script>
8 changes: 8 additions & 0 deletions resources/testharness.js
Original file line number Diff line number Diff line change
Expand Up @@ -3698,6 +3698,14 @@ policies and contribution forms [3].
if (global_scope.addEventListener) {
var error_handler = function(error, message, stack) {
var precondition_failed = error instanceof PreconditionFailedError;

// Modifying the harness status following completion could
// interfere with the value reported by some implementations
// (depending on the synchronicity of the reporting mechanism).
if (tests.phase === tests.phases.COMPLETE) {
return;
}

if (tests.file_is_test) {
var test = tests.tests[0];
if (test.phase >= test.phases.HAS_RESULT) {
Expand Down