commit 619372f1c31249f003a78c4680bf55687a37091d
parent be744649e41454e05e190394b75d81ac8ce99ab8
Author: Andrey Kosyakov <caseq@chromium.org>
Date: Mon, 5 Jan 2026 10:22:45 +0000
Bug 2007979 [wpt PR 56941] - Properly handle exceptions in navigator.credentials.create(), a=testonly
Automatic update from web-platform-tests
Properly handle exceptions in navigator.credentials.create()
We shouldn't resolve the promise if underlying call threw.
Fixed: 470784504
Change-Id: Id2eb2cd654a34afe4f083518ab3a4f3a827d596f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7318738
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1563321}
--
wpt-commits: f0e9a32fae2e853611c269b3a8ef256ac663ff56
wpt-pr: 56941
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/digital-credentials/create.tentative.https.html b/testing/web-platform/tests/digital-credentials/create.tentative.https.html
@@ -246,4 +246,16 @@
);
}
}, "Throws TypeError when request data is not JSON stringifiable.");
+
+ promise_test(async (t) => {
+ const options = {
+ password: document.createElement("form"),
+ };
+ await promise_rejects_js(
+ t,
+ TypeError,
+ navigator.credentials.create(options),
+ "Should throw for invalid form element"
+ );
+ }, "Throws when form element does not contain password.");
</script>