tree: 25eda2e61ece16b56ab86e1af4b548015cbd2cb2 [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. client_metadata_iframe.py
  14. continue_on.py
  15. continue_on_flexible_tokens.py
  16. disconnect.py
  17. disconnect_failure.py
  18. error_with_code_and_url.py
  19. error_with_error_and_url_format.py
  20. fedcm-helper.sub.js
  21. fedcm-helper.sub.js.headers
  22. fedcm-iframe-level2.html
  23. fedcm-iframe.html
  24. fedcm-mock.js
  25. fedcm-mojojs-helper.js
  26. fedcm-third-party-iframe.sub.html
  27. fencedframe-mark-signedin.html
  28. flexible_tokens.py
  29. idp_close.html
  30. iframe-mark-signedin.html
  31. keys.py
  32. lfedcm-helpers.js
  33. lfedcm-identity.provider-create.sub.html
  34. lfedcm-identity.provider-delete.sub.html
  35. login.html
  36. login_delay.html
  37. manifest-not-in-list.json
  38. manifest-token-nocors.json
  39. manifest.py
  40. manifest_accounts_push.json
  41. manifest_broken_login.json
  42. manifest_check_disclosure_shown_false.json
  43. manifest_check_disclosure_shown_true.json
  44. manifest_check_params.json
  45. manifest_check_same_site_strict.json
  46. manifest_continue_on_flexible_tokens.json
  47. manifest_flexible_tokens.json
  48. manifest_id_assertion_endpoint_returns_error.json
  49. manifest_id_assertion_endpoint_returns_error_format.json
  50. manifest_iframe.py
  51. manifest_no_accounts_login_delay.json
  52. manifest_no_login_url.json
  53. manifest_redirect_accounts.json
  54. manifest_redirect_token.json
  55. manifest_token_with_http_error.json
  56. manifest_with_auto_selected_flag.json
  57. manifest_with_continue_on.json
  58. manifest_with_cross_origin_disconnect.sub.json
  59. manifest_with_disconnect_failure.json
  60. manifest_with_no_accounts.json
  61. manifest_with_no_client_metadata.json
  62. manifest_with_picture_account.json
  63. manifest_with_rp_mode.json
  64. manifest_with_single_account.json
  65. manifest_with_single_identifier.json
  66. manifest_with_two_accounts.json
  67. manifest_with_variable_accounts.json
  68. mark_signedin
  69. mark_signedin.sub.headers
  70. mark_signedout
  71. mark_signedout.sub.headers
  72. no-cors.py
  73. no_accounts.py
  74. picture_account.py
  75. push_accounts
  76. push_accounts.sub.headers
  77. README.md
  78. request-params-check.py
  79. resolve.html
  80. resolve_flexible_tokens.html
  81. select_manifest_in_root_manifest.py
  82. set-well-known-format.py
  83. set_accounts_cookie.py
  84. set_cookie
  85. set_cookie.headers
  86. single_account.py
  87. single_identifier_accounts.py
  88. token.py
  89. token_check_disclosure_shown_false.py
  90. token_check_disclosure_shown_true.py
  91. token_check_params.py
  92. token_check_same_site_strict.py
  93. token_with_account_id.py
  94. token_with_auto_selected_flag.py
  95. token_with_http_error.py
  96. token_with_rp_mode.py
  97. two_accounts.py
  98. 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.