fedcm-multi-idp-context.https.html (1266B)
1 <!DOCTYPE html> 2 <title>Federated Credential Management API multi IDP context tests.</title> 3 <link rel="help" href="https://fedidcg.github.io/FedCM"> 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 9 <body> 10 11 <script type="module"> 12 import {request_options_with_two_idps, 13 fedcm_get_title_promise, 14 fedcm_test, 15 fedcm_select_account_promise} from '../support/fedcm-helper.sub.js'; 16 17 fedcm_test(async t => { 18 const p = navigator.credentials.get(request_options_with_two_idps()); 19 const result = await fedcm_get_title_promise(t); 20 assert_true(result.title.toLowerCase().includes('sign in')); 21 fedcm_select_account_promise(t, 0); 22 return p; 23 }, "FedCM multi IDP call defaults to 'signin' context."); 24 25 fedcm_test(async t => { 26 const options = request_options_with_two_idps(); 27 options.identity.context = "signup"; 28 const p = navigator.credentials.get(options); 29 const result = await fedcm_get_title_promise(t); 30 assert_true(result.title.toLowerCase().includes('sign up')); 31 fedcm_select_account_promise(t, 0); 32 return p; 33 }, "FedCM multi IDP with non-default context."); 34 </script>