Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>WebAuthn createWithHints</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>
<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>