Closed Bug 1835257 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 40248 - Fix promise rejection chaining in canvas tests

Categories

(Core :: Graphics: Canvas2D, task, P4)

task

Tracking

()

RESOLVED FIXED
116 Branch
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 outermost promise 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).

PR 40248 applied with additional changes from upstream: cc1bc6fb0c1cbf01c4b213f2e7235696cc134952
Component: web-platform-tests → Graphics: Canvas2D
Product: Testing → Core
Test result changes from PR not available.
Test result changes from PR not available.
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/68c5fc1e258e [wpt PR 40248] - Fix promise rejection chaining in canvas tests, a=testonly https://hg.mozilla.org/integration/autoland/rev/acb8ff3bbf59 [wpt PR 40248] - Update wpt metadata, a=testonly
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
You need to log in before you can comment on or make changes to this bug.