OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_AUTOFILL_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_AUTOFILL_HELPER_H_ |
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_AUTOFILL_HELPER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_AUTOFILL_HELPER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // Removes all of the keys from the WebDataService of sync profile |profile|. | 52 // Removes all of the keys from the WebDataService of sync profile |profile|. |
53 void RemoveKeys(int profile); | 53 void RemoveKeys(int profile); |
54 | 54 |
55 // Gets all the form fields in the WebDataService of sync profile |profile|. | 55 // Gets all the form fields in the WebDataService of sync profile |profile|. |
56 std::set<autofill::AutofillEntry> GetAllKeys(int profile) WARN_UNUSED_RESULT; | 56 std::set<autofill::AutofillEntry> GetAllKeys(int profile) WARN_UNUSED_RESULT; |
57 | 57 |
58 // Compares the form fields in the WebDataServices of sync profiles | 58 // Compares the form fields in the WebDataServices of sync profiles |
59 // |profile_a| and |profile_b|. Returns true if they match. | 59 // |profile_a| and |profile_b|. Returns true if they match. |
60 bool KeysMatch(int profile_a, int profile_b) WARN_UNUSED_RESULT; | 60 bool KeysMatch(int profile_a, int profile_b) WARN_UNUSED_RESULT; |
61 | 61 |
| 62 // Allows syncers to run until KeysMatch() returns true. |
| 63 bool AwaitKeysMatch(int profile_a, int profile_b); |
| 64 |
62 // Replaces the Autofill profiles in sync profile |profile| with | 65 // Replaces the Autofill profiles in sync profile |profile| with |
63 // |autofill_profiles|. | 66 // |autofill_profiles|. |
64 void SetProfiles(int profile, | 67 void SetProfiles(int profile, |
65 std::vector<autofill::AutofillProfile>* autofill_profiles); | 68 std::vector<autofill::AutofillProfile>* autofill_profiles); |
66 | 69 |
67 // Replaces the CreditCard profiles in sync profile |profile| with | 70 // Replaces the CreditCard profiles in sync profile |profile| with |
68 // |credit_cards|. | 71 // |credit_cards|. |
69 void SetCreditCards(int profile, | 72 void SetCreditCards(int profile, |
70 std::vector<autofill::CreditCard>* credit_cards); | 73 std::vector<autofill::CreditCard>* credit_cards); |
71 | 74 |
(...skipping 24 matching lines...) Expand all Loading... |
96 int GetKeyCount(int profile); | 99 int GetKeyCount(int profile); |
97 | 100 |
98 // Compares the Autofill profiles in the PersonalDataManagers of sync profiles | 101 // Compares the Autofill profiles in the PersonalDataManagers of sync profiles |
99 // |profile_a| and |profile_b|. Returns true if they match. | 102 // |profile_a| and |profile_b|. Returns true if they match. |
100 bool ProfilesMatch(int profile_a, int profile_b) WARN_UNUSED_RESULT; | 103 bool ProfilesMatch(int profile_a, int profile_b) WARN_UNUSED_RESULT; |
101 | 104 |
102 // Compares the autofill profiles for all sync profiles, and returns true if | 105 // Compares the autofill profiles for all sync profiles, and returns true if |
103 // they all match. | 106 // they all match. |
104 bool AllProfilesMatch() WARN_UNUSED_RESULT; | 107 bool AllProfilesMatch() WARN_UNUSED_RESULT; |
105 | 108 |
| 109 // Allows the syncers to run until ProfilesMatch() returns true. |
| 110 bool AwaitProfilesMatch(int profile_a, int profile_b); |
| 111 |
106 // Creates a test autofill profile based on the persona specified in |type|. | 112 // Creates a test autofill profile based on the persona specified in |type|. |
107 autofill::AutofillProfile CreateAutofillProfile(ProfileType type); | 113 autofill::AutofillProfile CreateAutofillProfile(ProfileType type); |
108 | 114 |
109 } // namespace autofill_helper | 115 } // namespace autofill_helper |
110 | 116 |
111 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_AUTOFILL_HELPER_H_ | 117 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_AUTOFILL_HELPER_H_ |
OLD | NEW |