blob: baa0313cd6813a0ad0767168c5dd9c430c7388d9 [file] [log] [blame]
(async function(testRunner) {
var {page, session, dp} =
await testRunner.startURL(
"https://devtools.test:8443/inspector-protocol/webauthn/resources/create-credential-test.https.html",
"Check that the WebAuthn command addVirtualAuthenticator works");
// Create an CTAP2 NFC authenticator and verify it is the one responding to
// navigator.credentials.create().
await dp.WebAuthn.enable();
const authenticatorId = (await dp.WebAuthn.addVirtualAuthenticator({
options: {
protocol: "ctap2",
transport: "nfc",
hasResidentKey: false,
hasUserVerification: false,
},
})).result.authenticatorId;
let result = JSON.parse(await session.evaluateAsync("registerCredential()"));
testRunner.log(result.status);
testRunner.log(result.credential.transports);
// Try with a BLE U2F authenticator.
await dp.WebAuthn.removeVirtualAuthenticator({ authenticatorId });
await dp.WebAuthn.addVirtualAuthenticator({
options: {
protocol: "u2f",
transport: "ble",
hasResidentKey: false,
hasUserVerification: false,
},
});
result = JSON.parse(await session.evaluateAsync("registerCredential()"));
testRunner.log(result.status);
testRunner.log(result.credential.transports);
testRunner.completeTest();
})