test_helpers.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Copyright (c) 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_PASSWORD_MANAGER_IOS_TEST_HELPERS_H_
  5. #define COMPONENTS_PASSWORD_MANAGER_IOS_TEST_HELPERS_H_
  6. #include <string>
  7. namespace autofill {
  8. struct FormData;
  9. struct PasswordFormFillData;
  10. struct FormData;
  11. } // namespace autofill
  12. namespace password_manager {
  13. struct FillData;
  14. } // namespace password_manager
  15. namespace test_helpers {
  16. // Populates |form_data| with test values.
  17. void SetPasswordFormFillData(const std::string& origin,
  18. const char* form_name,
  19. uint32_t unique_renderer_id,
  20. const char* username_field,
  21. uint32_t username_field_id,
  22. const char* username_value,
  23. const char* password_field,
  24. uint32_t password_field_id,
  25. const char* password_value,
  26. const char* additional_username,
  27. const char* additional_password,
  28. bool wait_for_username,
  29. autofill::PasswordFormFillData* form_data);
  30. // Populates |fill_data| with test values.
  31. void SetFillData(const std::string& origin,
  32. uint32_t unique_renderer_id,
  33. uint32_t username_field_id,
  34. const char* username_value,
  35. uint32_t password_field_id,
  36. const char* password_value,
  37. password_manager::FillData* fill_data);
  38. // Populates |form_data| with test values.
  39. void SetFormData(const std::string& origin,
  40. uint32_t unique_renderer_id,
  41. uint32_t username_field_id,
  42. const char* username_value,
  43. uint32_t password_field_id,
  44. const char* password_value,
  45. autofill::FormData* form_data);
  46. // Returns a simple FormData with test values.
  47. autofill::FormData MakeSimpleFormData();
  48. } // namespace test_helpers
  49. #endif // COMPONENTS_PASSWORD_MANAGER_IOS_TEST_HELPERS_H_