login-page-broken.https.html (1508B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>FedCM IDP log-in status API tests</title> 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_required, 11 fedcm_test, 12 fedcm_get_dialog_type_promise, 13 select_manifest} from '../support/fedcm-helper.sub.js'; 14 15 fedcm_test(async t => { 16 let test_options = request_options_with_mediation_required("manifest_broken_login.json"); 17 await select_manifest(t, test_options); 18 19 let cred_promise = navigator.credentials.get(test_options); 20 const cred_check = promise_rejects_dom(t, 'NetworkError', cred_promise); 21 let type = await fedcm_get_dialog_type_promise(t); 22 assert_equals(type, "ConfirmIdpLogin"); 23 24 // Manifest selection only persists for a single fetch, so we need to set it 25 // again because Chrome's implementation re-fetches the manifest as well, not 26 // just the accounts endpoint. 27 // TODO(crbug.com/392661388): This is not technically spec-compliant 28 await select_manifest(t, test_options); 29 await window.test_driver.click_fedcm_dialog_button("ConfirmIdpLoginContinue"); 30 31 // Because the login page never sends a signin status header, we 32 // expect a promise rejection. 33 return cred_check; 34 }, 'Tests that the promise does get resolved if a login page does not send a signin status header.'); 35 </script>