tree: 6b84b0c3497f2eb3afcb4a57385a74bd8a5d493a [path history] [tgz]
  1. fedcm/
  2. acao-cors.py
  3. accounts.py
  4. accounts_check_same_site_strict.py
  5. accounts_no_approved_clients.py
  6. client_metadata.py
  7. client_metadata.py.headers
  8. client_metadata_clear_count.py
  9. continue_on.py
  10. disconnect.py
  11. disconnect_failure.py
  12. error_with_code_and_url.py
  13. fedcm-helper.sub.js
  14. fedcm-helper.sub.js.headers
  15. fedcm-iframe-level2.html
  16. fedcm-iframe.html
  17. fedcm-mock.js
  18. fedcm-mojojs-helper.js
  19. fencedframe-mark-signedin.html
  20. iframe-mark-signedin.html
  21. keys.py
  22. lfedcm-helpers.js
  23. lfedcm-identity.provider-create.sub.html
  24. lfedcm-identity.provider-delete.sub.html
  25. login.html
  26. manifest-not-in-list.json
  27. manifest-token-nocors.json
  28. manifest.py
  29. manifest_check_disclosure_shown_false.json
  30. manifest_check_disclosure_shown_true.json
  31. manifest_check_params.json
  32. manifest_check_same_site_strict.json
  33. manifest_id_assertion_endpoint_returns_error.json
  34. manifest_no_login_url.json
  35. manifest_redirect_accounts.json
  36. manifest_redirect_token.json
  37. manifest_token_with_http_error.json
  38. manifest_with_auto_selected_flag.json
  39. manifest_with_continue_on.json
  40. manifest_with_cross_origin_disconnect.sub.json
  41. manifest_with_disconnect_failure.json
  42. manifest_with_no_accounts.json
  43. manifest_with_rp_mode.json
  44. manifest_with_single_account.json
  45. manifest_with_two_accounts.json
  46. manifest_with_variable_accounts.json
  47. mark_signedin
  48. mark_signedin.sub.headers
  49. mark_signedout
  50. mark_signedout.sub.headers
  51. no-cors.py
  52. no_accounts.py
  53. README.md
  54. request-params-check.py
  55. resolve.html
  56. select_manifest_in_root_manifest.py
  57. set_accounts_cookie.py
  58. set_cookie
  59. set_cookie.headers
  60. single_account.py
  61. token.py
  62. token_check_disclosure_shown_false.py
  63. token_check_disclosure_shown_true.py
  64. token_check_params.py
  65. token_check_same_site_strict.py
  66. token_with_account_id.py
  67. token_with_auto_selected_flag.py
  68. token_with_http_error.py
  69. token_with_rp_mode.py
  70. two_accounts.py
  71. variable_accounts.py
fedcm/support/README.md

FedCM Testing

fedcm-mojojs-helper.js exposes fedcm_mojo_mock_test which is a specialized promise_test which comes pre-setup with the appropriate mocking infrastructure to emulate platform federated auth backend. The mock is passed to the test function as the second parameter.

Example usage:

<script type="module">
  import {fedcm_mojo_mock_test} from './support/fedcm-mojojs-helper.js';

  fedcm_mojo_mock_test(async (t, mock) => {
    mock.returnToken("https://idp.test/fedcm.json", "a_token");
    assert_equals("a_token", await navigator.credentials.get(options));
  }, "Successfully obtaining a token using mock.");
</script>

The chromium implementation uses the MojoJS shim.