blob: c6f0136e0633b7847dad896f26d79d4f1f58bdb6 [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ WebAuthenticationModernEnabled=false ] -->
<title>Web Authentication API: PublicKeyCredential's [[get]] success cases with a mock nfc authenticator.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="./resources/util.js"></script>
<script>
// Default mock configuration. Tests need to override if they need different configuration.
if (window.internals)
internals.setMockWebAuthenticationConfiguration({ nfc: { error: "success", payloadBase64: [testNfcCtapVersionBase64, testGetInfoResponseApduBase64, testAssertionMessageApduBase64] } });
promise_test(t => {
const options = {
publicKey: {
challenge: Base64URL.parse("MTIzNDU2"),
timeout: 100
}
};
return navigator.credentials.get(options).then(credential => {
return checkCtapGetAssertionResult(credential);
});
}, "PublicKeyCredential's [[get]] with minimum options in a mock nfc authenticator.");
promise_test(t => {
const options = {
publicKey: {
challenge: Base64URL.parse("MTIzNDU2"),
allowCredentials: [{ type: "public-key", id: Base64URL.parse(testU2fCredentialIdBase64), transports: ["nfc"] }],
timeout: 100
}
};
if (window.internals)
internals.setMockWebAuthenticationConfiguration({ nfc: { error: "success", payloadBase64: [testNfcU2fVersionBase64, testU2fApduInsNotSupportedOnlyResponseBase64, testU2fSignResponse] } });
return navigator.credentials.get(options).then(credential => {
return checkU2fGetAssertionResult(credential);
});
}, "PublicKeyCredential's [[get]] with U2F in a mock nfc authenticator.");
</script>