fedcm-disclosure-text-shown.https.html (2698B)
1 <!DOCTYPE html> 2 <title>Federated Credential Management API network request 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 request_options_with_mediation_required, 15 fedcm_get_and_select_first_account} from '../support/fedcm-helper.sub.js'; 16 17 fedcm_test(async t => { 18 let options = request_options_with_mediation_required("manifest_check_disclosure_shown_false.json"); 19 options.identity.providers[0].clientId = "0"; 20 options.identity.providers[0].fields = ["non_default_field"]; 21 options.identity.providers[0].nonce = "non_default_field"; 22 const cred = await fedcm_get_and_select_first_account(t, options); 23 assert_equals(cred.token, "token"); 24 assert_equals(cred.isAutoSelected, false); 25 }, "We should send disclosure_text_shown=false when custom fields are passed."); 26 27 fedcm_test(async t => { 28 let options = request_options_with_mediation_required("manifest_check_disclosure_shown_false.json"); 29 options.identity.providers[0].clientId = "0"; 30 options.identity.providers[0].fields = []; 31 options.identity.providers[0].nonce = ""; 32 const cred = await fedcm_get_and_select_first_account(t, options); 33 assert_equals(cred.token, "token"); 34 assert_equals(cred.isAutoSelected, false); 35 }, "We should send disclosure_text_shown=false when an empty custom fields array is passed."); 36 37 38 fedcm_test(async t => { 39 let options = request_options_with_mediation_required("manifest_check_disclosure_shown_true.json"); 40 options.identity.providers[0].clientId = "0"; 41 options.identity.providers[0].nonce = "name,email,picture"; 42 const cred = await fedcm_get_and_select_first_account(t, options); 43 assert_equals(cred.token, "token"); 44 assert_equals(cred.isAutoSelected, false); 45 }, "We should send disclosure_text_shown=true when no custom fields are passed."); 46 47 fedcm_test(async t => { 48 let options = request_options_with_mediation_required("manifest_check_disclosure_shown_true.json"); 49 options.identity.providers[0].clientId = "0"; 50 options.identity.providers[0].fields = ["name", "email", "picture", "locale"]; 51 options.identity.providers[0].nonce = "name,email,picture,locale"; 52 const cred = await fedcm_get_and_select_first_account(t, options); 53 assert_equals(cred.token, "token"); 54 assert_equals(cred.isAutoSelected, false); 55 }, "We should send disclosure_text_shown=true when custom fields are passed in addition to standard fields."); 56 57 58 </script>