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