Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /WebCryptoAPI/import_export/crashtests/importKey-unsettled-promise.https.any.html - WPT Dashboard Interop Dashboard
- /WebCryptoAPI/import_export/crashtests/importKey-unsettled-promise.https.any.worker.html - WPT Dashboard Interop Dashboard
// META: title=WebCryptoAPI: Assure promise returned by importKey is settled.
// META: timeout=long
// META: script=/common/gc.js
'use strict';
promise_test(async () => {
const jwkKey = {};
const extractable = true;
crypto.subtle.importKey("jwk", jwkKey, {name: "UNSUPPORTED", hash: "SHA-224"}, extractable, []).then(
() => { assert_unreached("Unsupported algorithm should cause promise rejection")},
(err) => {
assert_equals(err.name, "NotSupportedError");
});
await garbageCollect();
})