tree: c3535cea0b0b5574290bb08f6a45c89f60ef8765 [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. idp_close.html
  21. iframe-mark-signedin.html
  22. keys.py
  23. lfedcm-helpers.js
  24. lfedcm-identity.provider-create.sub.html
  25. lfedcm-identity.provider-delete.sub.html
  26. login.html
  27. manifest-not-in-list.json
  28. manifest-token-nocors.json
  29. manifest.py
  30. manifest_broken_login.json
  31. manifest_check_disclosure_shown_false.json
  32. manifest_check_disclosure_shown_true.json
  33. manifest_check_params.json
  34. manifest_check_same_site_strict.json
  35. manifest_id_assertion_endpoint_returns_error.json
  36. manifest_no_login_url.json
  37. manifest_redirect_accounts.json
  38. manifest_redirect_token.json
  39. manifest_token_with_http_error.json
  40. manifest_with_auto_selected_flag.json
  41. manifest_with_continue_on.json
  42. manifest_with_cross_origin_disconnect.sub.json
  43. manifest_with_disconnect_failure.json
  44. manifest_with_no_accounts.json
  45. manifest_with_rp_mode.json
  46. manifest_with_single_account.json
  47. manifest_with_two_accounts.json
  48. manifest_with_variable_accounts.json
  49. mark_signedin
  50. mark_signedin.sub.headers
  51. mark_signedout
  52. mark_signedout.sub.headers
  53. no-cors.py
  54. no_accounts.py
  55. README.md
  56. request-params-check.py
  57. resolve.html
  58. select_manifest_in_root_manifest.py
  59. set_accounts_cookie.py
  60. set_cookie
  61. set_cookie.headers
  62. single_account.py
  63. token.py
  64. token_check_disclosure_shown_false.py
  65. token_check_disclosure_shown_true.py
  66. token_check_params.py
  67. token_check_same_site_strict.py
  68. token_with_account_id.py
  69. token_with_auto_selected_flag.py
  70. token_with_http_error.py
  71. token_with_rp_mode.py
  72. two_accounts.py
  73. 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.