fedcm-multi-idp-basic.https.html (1432B)
1 <!DOCTYPE html> 2 <title>Federated Credential Management API multi IDP basic success tests.</title> 3 <meta name="timeout" content="long"> 4 <link rel="help" href="https://fedidcg.github.io/FedCM"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="/resources/testdriver.js"></script> 8 <script src="/resources/testdriver-vendor.js"></script> 9 10 <body> 11 12 <script type="module"> 13 import {fedcm_test, 14 fedcm_get_and_select_first_account, 15 request_options_with_two_idps, 16 manifest_origin, 17 default_manifest_path, 18 fedcm_select_account_promise, 19 alt_manifest_origin} from '../support/fedcm-helper.sub.js'; 20 21 fedcm_test(async t => { 22 const cred = await fedcm_get_and_select_first_account(t, request_options_with_two_idps()); 23 assert_equals(cred.token, "token"); 24 assert_equals(cred.configURL, manifest_origin + default_manifest_path); 25 }, "Multi IDP FedCM call succeeds when picking the first account."); 26 27 fedcm_test(async t => { 28 const promise = navigator.credentials.get(request_options_with_two_idps()); 29 // Each IDP has one account, so select the second one. 30 fedcm_select_account_promise(t, 1); 31 const cred = await promise; 32 assert_equals(cred.token, "token"); 33 assert_equals(cred.configURL, alt_manifest_origin + default_manifest_path); 34 }, "Multi IDP FedCM call succeeds when picking account from the second IDP."); 35 </script>