Skip to content

Commit

Permalink
Cred Man: add basic get tests (#47268)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres authored Jul 29, 2024
1 parent 1aaf800 commit 8f374a1
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions credential-management/credentialscontainer-get-basics.https.html
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>

0 comments on commit 8f374a1

Please sign in to comment.