[wpt-sync] Sync PR 40248 - Fix promise rejection chaining in canvas tests
Categories
(Core :: Graphics: Canvas2D, task, P4)
Tracking
()
Tracking | Status | |
---|---|---|
firefox116 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 40248 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/40248
Details from upstream follow.
Philip Jägenstedt <philip@foolip.org> wrote:
Fix promise rejection chaining in canvas tests
The problem with these tests was that a failed assert in the innermost function would not end up failing the test. That's because of the difference between these two patterns:
promise.then(causeError, handleError);
promise.then(causeError).catch(handleError);
The former will result in an unhandled promise rejection, as the
handleError
callback is only invoked if the outermostpromise
is rejected, not if the promise resolution callback (causeError
) rejects.Fix this by simply chaining up to the the outer promise in these tests, where errors are handled with
.then(t_pass, t_fail)
.
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
Assignee | ||
Comment 3•2 years ago
|
||
Assignee | ||
Comment 4•2 years ago
|
||
Assignee | ||
Comment 6•2 years ago
|
||
Comment 7•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/68c5fc1e258e
https://hg.mozilla.org/mozilla-central/rev/acb8ff3bbf59
Description
•