-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cred Man: add basic get tests (#47268)
- Loading branch information
1 parent
1aaf800
commit 8f374a1
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
credential-management/credentialscontainer-get-basics.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!DOCTYPE html> | ||
<title>Credential Management API: create() basics.</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
promise_test(async (t) => { | ||
await promise_rejects_dom( | ||
t, | ||
"NotSupportedError", | ||
navigator.credentials.get() | ||
); | ||
|
||
await promise_rejects_dom( | ||
t, | ||
"NotSupportedError", | ||
navigator.credentials.get({}) | ||
); | ||
|
||
await promise_rejects_dom( | ||
t, | ||
"NotSupportedError", | ||
navigator.credentials.get({ x: "y" }) | ||
); | ||
|
||
await promise_rejects_dom( | ||
t, | ||
"NotSupportedError", | ||
navigator.credentials.get({ x: "y", y: "z" }) | ||
); | ||
|
||
await promise_rejects_dom( | ||
t, | ||
"NotSupportedError", | ||
navigator.credentials.get({ x: "y" }) | ||
); | ||
|
||
await promise_rejects_dom( | ||
t, | ||
"NotSupportedError", | ||
navigator.credentials.get({ mediation: "required" }) | ||
); | ||
|
||
const abortController = new AbortController(); | ||
const { signal } = abortController; | ||
await promise_rejects_dom( | ||
t, | ||
"NotSupportedError", | ||
navigator.credentials.get({ signal }) | ||
); | ||
|
||
await promise_rejects_dom( | ||
t, | ||
"NotSupportedError", | ||
navigator.credentials.get({ signal, mediation: "required" }) | ||
); | ||
}, "Calling navigator.credentials.get() without a valid matching interface."); | ||
</script> |