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

Unified Diff: chrome/browser/sync/profile_sync_service_harness.cc

Issue 7753023: [Sync] Add tests for migration triggered by notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 4 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
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.h ('k') | chrome/test/live_sync/live_sync_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service_harness.cc
diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc
index 2d0fd3e6eb31881e419f29f12bc8307d43c358dd..dcd5ed51a4eacbf710283a58f2c3814e4bcd1b2b 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -95,8 +95,7 @@ bool StateChangeTimeoutEvent::Abort() {
ProfileSyncServiceHarness::ProfileSyncServiceHarness(
Profile* profile,
const std::string& username,
- const std::string& password,
- bool expected_notifications_enabled)
+ const std::string& password)
: waiting_for_encryption_type_(syncable::UNSPECIFIED),
wait_state_(INITIAL_WAIT_STATE),
profile_(profile),
@@ -104,7 +103,6 @@ ProfileSyncServiceHarness::ProfileSyncServiceHarness(
timestamp_match_partner_(NULL),
username_(username),
password_(password),
- expected_notifications_enabled_(expected_notifications_enabled),
profile_debug_name_(profile->GetDebugName()) {
if (IsSyncAlreadySetup()) {
service_ = profile_->GetProfileSyncService();
@@ -122,9 +120,7 @@ ProfileSyncServiceHarness* ProfileSyncServiceHarness::CreateAndAttach(
NOTREACHED() << "Profile has never signed into sync.";
return NULL;
}
- return new ProfileSyncServiceHarness(
- profile, "", "",
- /* expected_notifications_enabled */ true);
+ return new ProfileSyncServiceHarness(profile, "", "");
}
void ProfileSyncServiceHarness::SetCredentials(const std::string& username,
@@ -473,6 +469,17 @@ bool ProfileSyncServiceHarness::AwaitSyncCycleCompletion(
return true;
}
+ return AwaitSyncCycleCompletionHelper(reason);
+}
+
+bool ProfileSyncServiceHarness::AwaitNextSyncCycleCompletion(
+ const std::string& reason) {
+ VLOG(1) << GetClientInfoString("AwaitNextSyncCycleCompletion");
+ return AwaitSyncCycleCompletionHelper(reason);
+}
+
+bool ProfileSyncServiceHarness::AwaitSyncCycleCompletionHelper(
+ const std::string& reason) {
if (wait_state_ == SERVER_UNREACHABLE) {
// Client was offline; wait for it to go online, and then wait for sync.
AwaitStatusChangeWithTimeout(kLiveSyncOperationTimeoutMs, reason);
@@ -620,8 +627,7 @@ bool ProfileSyncServiceHarness::IsSynced() {
bool is_synced = snap &&
snap->num_blocking_conflicting_updates == 0 &&
ServiceIsPushingChanges() &&
- (GetStatus().notifications_enabled ==
- expected_notifications_enabled_) &&
+ GetStatus().notifications_enabled &&
!service()->HasUnsyncedItems() &&
!snap->has_more_to_sync &&
snap->unsynced_count == 0 &&
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.h ('k') | chrome/test/live_sync/live_sync_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698