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

Side by Side Diff: chrome/browser/sync/test/integration/sync_integration_test_util.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SYNC_INTEGRATION_TEST_UTIL_H_ 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_INTEGRATION_TEST_UTIL_H_
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_INTEGRATION_TEST_UTIL_H_ 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_INTEGRATION_TEST_UTIL_H_
7 7
8 #include <string>
9
10 #include "chrome/browser/sync/test/integration/fake_server_match_status_checker. h"
11 #include "chrome/browser/sync/test/integration/single_client_status_change_check er.h"
8 #include "components/sync/base/model_type.h" 12 #include "components/sync/base/model_type.h"
9 13
10 namespace browser_sync { 14 namespace browser_sync {
11 class ProfileSyncService; 15 class ProfileSyncService;
12 } // namespace browser_sync 16 } // namespace browser_sync
13 17
14 namespace fake_server { 18 // Checker to block until the server has a given number of entities.
15 class FakeServer; 19 class ServerCountMatchStatusChecker
16 } // namespace fake_server 20 : public fake_server::FakeServerMatchStatusChecker {
21 public:
22 ServerCountMatchStatusChecker(syncer::ModelType type, size_t count);
17 23
18 namespace sync_integration_test_util { 24 // StatusChangeChecker implementation.
25 bool IsExitConditionSatisfied() override;
26 std::string GetDebugMessage() const override;
19 27
20 // Wait until the provided |service| is blocked waiting for a passphrase. 28 private:
21 bool AwaitPassphraseRequired(browser_sync::ProfileSyncService* service); 29 const syncer::ModelType type_;
30 const size_t count_;
31 };
22 32
23 // Wait until the provided |service| has accepted the new passphrase. 33 // Checker to block until service is waiting for a passphrase.
24 bool AwaitPassphraseAccepted(browser_sync::ProfileSyncService* service); 34 class PassphraseRequiredChecker : public SingleClientStatusChangeChecker {
35 public:
36 explicit PassphraseRequiredChecker(browser_sync::ProfileSyncService* service);
25 37
26 // Wait until the |service| is fully synced. 38 // StatusChangeChecker implementation.
27 // This can be a bit flaky. See UpdatedProgressMarkerChecker for details. 39 bool IsExitConditionSatisfied() override;
28 bool AwaitCommitActivityCompletion(browser_sync::ProfileSyncService* service); 40 std::string GetDebugMessage() const override;
41 };
29 42
30 // Wait until the fake server has a specific count for the given type. 43 // Checker to block until service has accepted a new passphrase.
31 bool AwaitServerCount(syncer::ModelType type, size_t count); 44 class PassphraseAcceptedChecker : public SingleClientStatusChangeChecker {
45 public:
46 explicit PassphraseAcceptedChecker(browser_sync::ProfileSyncService* service);
32 47
33 } // namespace sync_integration_test_util 48 // StatusChangeChecker implementation.
49 bool IsExitConditionSatisfied() override;
50 std::string GetDebugMessage() const override;
51 };
34 52
35 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_INTEGRATION_TEST_UTIL_H_ 53 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_INTEGRATION_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698