Open Bug 1905554 Opened 9 days ago Updated 1 hour ago

[wpt-sync] Sync PR 46946 - Correctly reject promise if failed to normalize algorithm

Categories

(Core :: DOM: Web Crypto, task, P4)

task

Tracking

()

People

(Reporter: wpt-sync, Unassigned)

References

(Depends on 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 46946 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/46946
Details from upstream follow.

Andrey Kosyakov <caseq@chromium.org> wrote:

Correctly reject promise if failed to normalize algorithm

We used to leave the promise returned by crypto.subtle.importKey and some other crypto methods in an unsettled state in case the method failed with unsupported algorithm, which has been caught by a recently introduced DCHECK().
This fixes the invariant, along with bringing this and other crypto methods to spec compliance: an unsupported algorithm is generally
supposed to cause promise rejection rather than synchronous exception
according to https://w3c.github.io/webcrypto/:

If an error occurred, return a Promise rejected with normalizedAlgorithm.

Bug: 349877609
Change-Id: I72288a3fe084a2bf2ed2b30a4d01d41a4f0fa571

Reviewed-on: https://chromium-review.googlesource.com/5668545
WPT-Export-Revision: a505f9d98af6c998772bf843f3438322a82fd89b

Component: web-platform-tests → DOM: Web Crypto
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests and 1 subtests

Status Summary

Firefox

OK : 2
PASS: 2

Chrome

OK : 2
PASS: 2

Safari

OK : 2
PASS: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

You need to log in before you can comment on or make changes to this bug.