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

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

Issue 2379433002: [Sync] Refactoring of sync integration test checkers to remove boilerplate await methods. (Closed)
Patch Set: Fixing another ChromeOS test. Created 4 years, 3 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/sessions_helper.h
diff --git a/chrome/browser/sync/test/integration/sessions_helper.h b/chrome/browser/sync/test/integration/sessions_helper.h
index 3700b984f3551bcdda8734c65914064422f326f8..6fbf79525e721b5e4761affbedb1874ecde402f2 100644
--- a/chrome/browser/sync/test/integration/sessions_helper.h
+++ b/chrome/browser/sync/test/integration/sessions_helper.h
@@ -6,10 +6,13 @@
#define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SESSIONS_HELPER_H_
#include <algorithm>
+#include <map>
+#include <memory>
#include <string>
#include <vector>
#include "base/compiler_specific.h"
+#include "chrome/browser/sync/test/integration/multi_client_status_change_checker.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "components/sessions/core/session_types.h"
#include "components/sync/syncable/nigori_util.h"
@@ -81,12 +84,6 @@ bool CheckForeignSessionsAgainst(
int index,
const std::vector<ScopedWindowMap>& windows);
-// Retrieves the foreign sessions for a particular profile and compares them
-// to the reference windows using CheckForeignSessionsAgains. Returns true if
-// they match and doesn't time out.
-bool AwaitCheckForeignSessionsAgainst(
- int index, const std::vector<ScopedWindowMap>& windows);
-
// Open a single tab and block until the session model associator is aware
// of it. Returns true upon success, false otherwise.
bool OpenTab(int index, const GURL& url);
@@ -115,4 +112,21 @@ void DeleteForeignSession(int index, std::string session_tag);
} // namespace sessions_helper
+// Checker to block until the foreign sessions for a particular profile matches
+// the reference windows.
+class CheckForeignSessionsChecker : public MultiClientStatusChangeChecker {
maxbogue 2016/09/30 16:27:55 Shouldn't this be ForeignSessionsMatchChecker to f
skym 2016/09/30 17:43:21 Done.
+ public:
+ CheckForeignSessionsChecker(
+ int index,
+ const std::vector<sessions_helper::ScopedWindowMap>& windows);
+
+ // StatusChangeChecker implementation.
+ bool IsExitConditionSatisfied() override;
+ std::string GetDebugMessage() const override;
+
+ private:
+ int index_;
+ const std::vector<sessions_helper::ScopedWindowMap>& windows_;
+};
+
#endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SESSIONS_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698