createcredential-attachment.https.html (2705B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <meta name="timeout" content="long"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="/resources/testdriver.js"></script> 7 <script src="/resources/testdriver-vendor.js"></script> 8 <script src=helpers.js></script> 9 <body></body> 10 <script> 11 "use strict"; 12 // usb transport 13 virtualAuthenticatorPromiseTest(async function() { 14 const credential = await createCredential({ 15 options: { 16 publicKey: { 17 authenticatorSelection: { 18 userVerification: "preferred" 19 }, 20 }, 21 }, 22 }); 23 assert_equals(credential.authenticatorAttachment, "cross-platform"); 24 }, { 25 protocol: "ctap2", 26 transport: "usb" 27 }, "navigator.credentials.create() with usb authenticator, attachment as cross-platform"); 28 29 // ble transport 30 virtualAuthenticatorPromiseTest(async function() { 31 const credential = await createCredential({ 32 options: { 33 publicKey: { 34 authenticatorSelection: { 35 userVerification: "preferred" 36 }, 37 }, 38 }, 39 }); 40 assert_equals(credential.authenticatorAttachment, "cross-platform"); 41 }, { 42 protocol: "ctap2", 43 transport: "ble" 44 }, "navigator.credentials.create() with ble authenticator, attachment as cross-platform"); 45 46 // nfc transport 47 virtualAuthenticatorPromiseTest(async function() { 48 const credential = await createCredential({ 49 options: { 50 publicKey: { 51 authenticatorSelection: { 52 userVerification: "preferred" 53 }, 54 }, 55 }, 56 }); 57 assert_equals(credential.authenticatorAttachment, "cross-platform"); 58 }, { 59 protocol: "ctap2", 60 transport: "nfc" 61 }, "navigator.credentials.create() with nfc authenticator, attachment as cross-platform"); 62 63 // internal transport 64 virtualAuthenticatorPromiseTest(async function() { 65 const credential = await createCredential({ 66 options: { 67 publicKey: { 68 authenticatorSelection: { 69 userVerification: "preferred" 70 }, 71 }, 72 }, 73 }); 74 assert_equals(credential.authenticatorAttachment, "platform"); 75 }, { 76 protocol: "ctap2", 77 transport: "internal" 78 }, "navigator.credentials.create() with internal authenticator, attachment as platform"); 79 </script>