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