blob: 2382e878de4c7de067078cbcec025eb39fd9a2fc [file] [edit]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WebAuthn createWithHints</title>
<meta name="timeout" content="long">
<link rel="help" href="https://w3c.github.io/webauthn/#sctn-public-key-easy">
<link rel="help" href="https://w3c.github.io/webauthn/#enum-hints">
<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>
<script>
function testCreateWithHints() {
"use strict";
// Hints affect UI, which cannot be tested here. Check that unknown and
// repeated hints do not prevent creation.
standardSetup(function() {
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 CreateCredentialsTest("options.publicKey.hints", hints)
.runTest(`navigator.credentials.create() accepts hints ${JSON.stringify(hints)}`);
}
});
}
testCreateWithHints();
</script>
</head>
<body></body>
</html>