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

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

Issue 165393010: Draft: Moving code out of ProfileSyncServiceHarness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/profile_sync_service_harness.h
diff --git a/chrome/browser/sync/test/integration/profile_sync_service_harness.h b/chrome/browser/sync/test/integration/profile_sync_service_harness.h
index ee3c728fd321bb6333beefa86f70be99308f05a6..4edc47b6062a0240a5a3d8f341d5781238237d3c 100644
--- a/chrome/browser/sync/test/integration/profile_sync_service_harness.h
+++ b/chrome/browser/sync/test/integration/profile_sync_service_harness.h
@@ -16,6 +16,7 @@
class Profile;
class StatusChangeChecker;
+class P2PInvalidationForwarder;
namespace invalidation {
class P2PInvalidationService;
@@ -32,8 +33,7 @@ class SyncSessionSnapshot;
// profile passed to it on construction and automates certain things like setup
// and authentication. It provides ways to "wait" adequate periods of time for
// several clients to get to the same state.
-class ProfileSyncServiceHarness
- : public ProfileSyncServiceObserver {
+class ProfileSyncServiceHarness {
public:
static ProfileSyncServiceHarness* Create(
Profile* profile,
@@ -67,10 +67,6 @@ class ProfileSyncServiceHarness
// in |synced_datatypes|.
bool SetupSync(syncer::ModelTypeSet synced_datatypes);
- // ProfileSyncServiceObserver implementation.
- virtual void OnStateChanged() OVERRIDE;
- virtual void OnSyncCycleCompleted() OVERRIDE;
-
// Blocks the caller until the sync backend host associated with this harness
// has been initialized. Returns true if the wait was successful.
bool AwaitBackendInitialized();
@@ -87,10 +83,6 @@ class ProfileSyncServiceHarness
// true if sync setup is complete.
bool AwaitSyncSetupCompletion();
- // Blocks the caller until this harness has observed that the sync engine
- // has downloaded all the changes seen by the |partner| harness's client.
- bool WaitUntilProgressMarkersMatch(ProfileSyncServiceHarness* partner);
-
// Calling this acts as a barrier and blocks the caller until |this| and
// |partner| have both completed a sync cycle. When calling this method,
// the |partner| should be the passive responder who responds to the actions
@@ -167,14 +159,6 @@ class ProfileSyncServiceHarness
// Check if |type| is being synced.
bool IsTypePreferred(syncer::ModelType type);
- // Get the number of sync entries this client has. This includes all top
- // level or permanent items, and can include recently deleted entries.
- size_t GetNumEntries() const;
-
- // Get the number of sync datatypes registered (ignoring whatever state
- // they're in).
- size_t GetNumDatatypes() const;
-
// Gets the |auto_start_enabled_| variable from the |service_|.
bool AutoStartEnabled();
@@ -182,9 +166,8 @@ class ProfileSyncServiceHarness
// returns true, indicating that the status change we are waiting for has
// taken place. Caller retains ownership of |checker|, which must outlive this
// method. Returns true if the status change was observed. In case of a
- // timeout, we log the |source| of the call to this method, and return false.
- bool AwaitStatusChange(StatusChangeChecker* checker,
- const std::string& source);
+ // timeout, we CHECK(false).
+ bool AwaitStatusChange(StatusChangeChecker* checker);
// Returns a string that can be used as the value of an oauth2 refresh token.
// This function guarantees that a different string is returned each time
@@ -195,10 +178,6 @@ class ProfileSyncServiceHarness
// available), annotated with |message|. Useful for logging.
std::string GetClientInfoString(const std::string& message) const;
- // Returns true if this client has downloaded all the items that the
- // other client has.
- bool MatchesPartnerClient() const;
-
private:
ProfileSyncServiceHarness(
Profile* profile,
@@ -213,11 +192,6 @@ class ProfileSyncServiceHarness
// Signals that sync setup is complete, and that PSS may begin syncing.
void FinishSyncSetup();
- // Gets the current progress marker of the current sync session for a
- // particular datatype. Returns an empty string if the progress marker isn't
- // found.
- std::string GetSerializedProgressMarker(syncer::ModelType model_type) const;
-
// Returns true if a client has nothing left to commit and its progress
// markers are up to date.
bool HasLatestProgressMarkers() const;
@@ -234,6 +208,9 @@ class ProfileSyncServiceHarness
// P2PInvalidationService associated with |profile_|.
invalidation::P2PInvalidationService* p2p_invalidation_service_;
+ // An bridge between the ProfileSyncService and P2PInvalidationService.
+ scoped_ptr<P2PInvalidationForwarder> p2p_invalidation_forwarder_;
+
// The harness of the client whose update progress marker we're expecting
// eventually match.
ProfileSyncServiceHarness* progress_marker_partner_;
@@ -249,10 +226,6 @@ class ProfileSyncServiceHarness
// Used for logging.
const std::string profile_debug_name_;
- // Keeps track of the state change on which we are waiting. PSSHarness can
- // wait on only one status change at a time.
- StatusChangeChecker* status_change_checker_;
-
DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceHarness);
};

Powered by Google App Engine
This is Rietveld 408576698