Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset=utf-8>
<head>
<title>Test for W3C Web Authentication isUserVerifyingPlatformAuthenticatorAvailable</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="u2futil.js"></script>
<script type="text/javascript" src="pkijs/common.js"></script>
<script type="text/javascript" src="pkijs/asn1.js"></script>
<script type="text/javascript" src="pkijs/x509_schema.js"></script>
<script type="text/javascript" src="pkijs/x509_simpl.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<h1>Test for W3C Web Authentication isUserVerifyingPlatformAuthenticatorAvailable</h1>
<script class="testbody" type="text/javascript">
"use strict";
add_task(async function test_uvpaa_with_no_authenticator() {
let uvpaa = await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();
ok(uvpaa === false, "Platform authenticator is not available");
});
add_task(async () => {
await addVirtualAuthenticator("ctap2_1", "usb");
});
add_task(async function test_uvpaa_with_usb_authenticator() {
let uvpaa = await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();
ok(uvpaa === false, "Platform authenticator is not available");
});
add_task(async () => {
await addVirtualAuthenticator("ctap2_1", "internal");
});
add_task(async function test_uvpaa_with_usb_and_platform_authenticator() {
let uvpaa = await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();
ok(uvpaa === true, "Platform authenticator is available");
});
</script>
</body>
</html>