Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /webauthn/getcredential-hints.https.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>navigator.credentials.get() with hints</title>
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src=helpers.js></script>
<body></body>
<script>
standardSetup(async function() {
"use strict";
const credPromise = createCredential();
// Hints affect UI, which cannot be tested here. Check that unknown and
// repeated hints do not prevent authentication.
for (const hints of [
["duplicated-value", "not-a-defined-value", "duplicated-value"],
["security-key", "security-key"],
["client-device", "client-device"],
["hybrid", "hybrid"],
["security-key", "client-device", "security-key"],
["client-device", "hybrid", "security-key", "client-device", "hybrid", "security-key"],
["not-a-defined-value", "security-key", "not-a-defined-value", "security-key"],
]) {
new GetCredentialsTest("options.publicKey.hints", hints)
.addCredential(credPromise)
.runTest(`navigator.credentials.get() accepts hints ${JSON.stringify(hints)}`);
}
}, {});
</script>