fedcm-button-mode-auto-selected-flag.tentative.https.html (1384B)
1 <!DOCTYPE html> 2 <title>Federated Credential Management API Active Mode auto selected flag 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 <script type="module"> 10 import {request_options_with_mediation_optional, 11 fedcm_test, 12 select_manifest, 13 fedcm_get_and_select_first_account} from '../support/fedcm-helper.sub.js'; 14 15 fedcm_test(async t => { 16 let test_options = request_options_with_mediation_optional("manifest_with_auto_selected_flag.json"); 17 test_options.identity.mode = "active"; 18 19 return test_driver.bless('initiate FedCM request', async function() { 20 await select_manifest(t, test_options); 21 22 let cred = await fedcm_get_and_select_first_account(t, test_options); 23 assert_equals(cred.token, "is_auto_selected=false"); 24 25 test_options = request_options_with_mediation_optional("manifest_with_auto_selected_flag.json"); 26 await select_manifest(t, test_options); 27 28 cred = await navigator.credentials.get(test_options); 29 assert_equals(cred.token, "is_auto_selected=true"); 30 assert_equals(cred.isAutoSelected, true); 31 }); 32 }, "Test that the auto selected flag can be true in active mode."); 33 34 </script>