Chromium Code Reviews| Index: chrome/browser/sync/test/integration/autofill_helper.h |
| diff --git a/chrome/browser/sync/test/integration/autofill_helper.h b/chrome/browser/sync/test/integration/autofill_helper.h |
| index 14dca507948aa2c855bf7016226fad9c883367dc..9556f099ebc8b47a2ac94fcb0e97aceb7075bfa9 100644 |
| --- a/chrome/browser/sync/test/integration/autofill_helper.h |
| +++ b/chrome/browser/sync/test/integration/autofill_helper.h |
| @@ -12,7 +12,9 @@ |
| #include "base/compiler_specific.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/strings/string16.h" |
| +#include "chrome/browser/sync/test/integration/multi_client_status_change_checker.h" |
| #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
| +#include "components/autofill/core/browser/personal_data_manager_observer.h" |
| namespace autofill { |
| class AutofillEntry; |
| @@ -59,9 +61,6 @@ std::set<autofill::AutofillEntry> GetAllKeys(int profile) WARN_UNUSED_RESULT; |
| // |profile_a| and |profile_b|. Returns true if they match. |
| bool KeysMatch(int profile_a, int profile_b) WARN_UNUSED_RESULT; |
| -// Allows syncers to run until KeysMatch() returns true. |
| -bool AwaitKeysMatch(int profile_a, int profile_b); |
| - |
| // Replaces the Autofill profiles in sync profile |profile| with |
| // |autofill_profiles|. |
| void SetProfiles(int profile, |
| @@ -106,9 +105,6 @@ bool ProfilesMatch(int profile_a, int profile_b) WARN_UNUSED_RESULT; |
| // they all match. |
| bool AllProfilesMatch() WARN_UNUSED_RESULT; |
| -// Allows the syncers to run until ProfilesMatch() returns true. |
| -bool AwaitProfilesMatch(int profile_a, int profile_b); |
| - |
| // Creates a test autofill profile based on the persona specified in |type|. |
| autofill::AutofillProfile CreateAutofillProfile(ProfileType type); |
| @@ -117,4 +113,37 @@ autofill::AutofillProfile CreateUniqueAutofillProfile(); |
| } // namespace autofill_helper |
| +// Checker to block until autofill keys match on both profiles. |
| +class AutofillKeysChecker : public MultiClientStatusChangeChecker { |
|
maxbogue
2016/09/30 16:27:55
I still think it's weird that these are outside th
skym
2016/09/30 17:43:21
Acknowledged.
|
| + public: |
| + AutofillKeysChecker(int profile_a, int profile_b); |
| + |
| + // StatusChangeChecker implementation. |
| + bool IsExitConditionSatisfied() override; |
| + std::string GetDebugMessage() const override; |
| + |
| + private: |
| + const int profile_a_; |
| + const int profile_b_; |
| +}; |
| + |
| +// Checker to block until autofill profiles match on both profiles. |
| +class AutofillProfileChecker : public StatusChangeChecker, |
| + public autofill::PersonalDataManagerObserver { |
| + public: |
| + AutofillProfileChecker(int profile_a, int profile_b); |
| + ~AutofillProfileChecker() override; |
| + |
| + // StatusChangeChecker implementation. |
| + bool IsExitConditionSatisfied() override; |
| + std::string GetDebugMessage() const override; |
| + |
| + // autofill::PersonalDataManager implementation. |
| + void OnPersonalDataChanged() override; |
| + |
| + private: |
| + const int profile_a_; |
| + const int profile_b_; |
| +}; |
| + |
| #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_AUTOFILL_HELPER_H_ |