Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1678)

Unified Diff: chrome/browser/sync/test/integration/dictionary_helper.h

Issue 2379433002: [Sync] Refactoring of sync integration test checkers to remove boilerplate await methods. (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/integration/dictionary_helper.h
diff --git a/chrome/browser/sync/test/integration/dictionary_helper.h b/chrome/browser/sync/test/integration/dictionary_helper.h
index cd7329163a0ced5a864aa816b98992702c11776d..2e8cde144222ac4330d0bfcfbda09d8e9f5c16c3 100644
--- a/chrome/browser/sync/test/integration/dictionary_helper.h
+++ b/chrome/browser/sync/test/integration/dictionary_helper.h
@@ -9,6 +9,9 @@
#include <string>
+#include "chrome/browser/sync/test/integration/multi_client_status_change_checker.h"
+#include "chrome/browser/sync/test/integration/single_client_status_change_checker.h"
+
namespace dictionary_helper {
// Synchronously loads the dictionaries across all profiles. Also loads the
@@ -26,14 +29,6 @@ size_t GetVerifierDictionarySize();
// verifier if DisableVerifier() hasn't been called.
bool DictionariesMatch();
-// Waits until dictionaries match across all platforms. Returns false
-// if this operation times out.
-bool AwaitDictionariesMatch();
-
-// Waits until the profile at the given index contains exactly |num| dictionary
-// entries. Returns false if this operation times out.
-bool AwaitNumDictionaryEntries(int index, size_t num_words);
-
// Used to verify that the dictionary within a particular sync profile matches
// the dictionary within the verifier sync profile.
bool DictionaryMatchesVerifier(int index);
@@ -55,4 +50,29 @@ bool RemoveWord(int index, const std::string& word);
} // namespace dictionary_helper
+// Checker to block until all services have matching dictionaries.
+class DictionaryMatchChecker : public MultiClientStatusChangeChecker {
+ public:
+ DictionaryMatchChecker();
+
+ // StatusChangeChecker implementation.
+ bool IsExitConditionSatisfied() override;
+ std::string GetDebugMessage() const override;
+};
+
+// Checker to block until the number of dictionary entries to equal to an
+// expected count.
+class NumDictionaryEntriesChecker : public SingleClientStatusChangeChecker {
+ public:
+ NumDictionaryEntriesChecker(int index, size_t num_words);
+
+ // StatusChangeChecker implementation.
+ bool IsExitConditionSatisfied() override;
+ std::string GetDebugMessage() const override;
+
+ private:
+ int index_;
+ size_t num_words_;
+};
+
#endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_DICTIONARY_HELPER_H_
« no previous file with comments | « chrome/browser/sync/test/integration/bookmarks_helper.cc ('k') | chrome/browser/sync/test/integration/dictionary_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698