Skip to content

Commit

Permalink
Improve error message when navigator.identity.digital.providers == []
Browse files Browse the repository at this point in the history
This CL improves the error message when
navigator.identity.digital.providers == []

BUG=330560074

Change-Id: I69c5401133e12ed01e6d2ae97645ad0d832c699f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5383607
Commit-Queue: Peter Kotwicz <[email protected]>
Reviewed-by: Christian Biesinger <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1275783}
  • Loading branch information
pkotwicz authored and BruceDai committed Mar 25, 2024
1 parent f6a5d74 commit 2980c72
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions credential-management/digital-identity.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@
await promise_rejects_js(t, TypeError, navigator.identity.get(request));
}, "navigator.identity.get() API fails if DigitalCredentialRequestOptions::providers is not specified.");

promise_test(async t => {
let request = buildValidNavigatorIdentityRequest();
request.digital.providers = [];
await promise_rejects_js(t, TypeError, navigator.identity.get(request));
}, "navigator.identity.get() API fails if there are no providers.");

promise_test(async t => {
let request = buildValidNavigatorIdentityRequest();
let providerCopy = structuredClone(request.digital.providers[0]);
Expand Down

0 comments on commit 2980c72

Please sign in to comment.