blob: 877efa189ae6c70b64642802d2730d44324c8d4c [file] [edit]
<!DOCTYPE html>
<title>Digital Credentials API: create() default behavior checks.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async (t) => {
await assert_equals(
await navigator.identity.create(),
null,
"No argument defaults be null."
);
await assert_equals(
await navigator.identity.create({}),
null,
"Empty dictionary defaults be null."
);
await assert_equals(
await navigator.identity.create({ identity: "bogus data" }),
null,
"The identity member is not part of CredentialCreationOptions, so defaults be null."
);
const controller = new AbortController();
controller.abort();
await promise_rejects_dom(
t,
"AbortError",
navigator.identity.create({ signal: controller.signal }),
"create() with abort signal set that was already aborted."
);
}, "create() checks.");
promise_test(async (t)=>{
await promise_rejects_js(
t,
TypeError,
navigator.identity.create({ publicKey: "bogus data" }),
"The Digital Credential API knows about public key."
);
}, "Interaction with Web Authn API.")
</script>