summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-20 01:55:58 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-20 01:55:58 +0000
commit7abf3183897154f9fac42a5b1df00acaecfd1a15 (patch)
treedc765e5d188198100f440476a5dfedfbd698fcc4 /chrome
parent8a0a4f925b12be6cabf3f9e96d5acea42b7a20aa (diff)
downloadchromium_src-7abf3183897154f9fac42a5b1df00acaecfd1a15.zip
chromium_src-7abf3183897154f9fac42a5b1df00acaecfd1a15.tar.gz
chromium_src-7abf3183897154f9fac42a5b1df00acaecfd1a15.tar.bz2
Make IsSynced() false when syncing in progress
This works around an issue in the integration tests where the tests would sometimes see a stale snapshot and assume it was up to date. The snapshot is only updated at the end of a sync cycle, but the integration tests sometimes get woken up mid-cycle. This doesn't actually cause problems on trunk right now. I only noticed the issue because some local changes exposed it. This bug, in combniation with my changes, would cause IsSynced() to return false positives in some situations. Ensuring that IsSynced() is always false when we're undergoing a sync cycle hides the issue. It could be argued that we're not actually synced if a sync cycle is in progress, and therefore this change actually results in a better defenition of IsSynced(). However, the issue I'm trying to work around, that the integration test harness is woken up to receive stale snapshots, is not necessarily related to this and could be fixed in other ways. This change is a prerequisite for a patch I'm working on that should fix issue 94670. BUG=95742, 94670 TEST= Review URL: http://codereview.chromium.org/7956003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101893 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/sync/profile_sync_service_harness.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc
index 6b09d1f..ba88bed 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -729,12 +729,14 @@ bool ProfileSyncServiceHarness::IsSynced() {
return false;
}
const SyncSessionSnapshot* snap = GetLastSessionSnapshot();
+ const ProfileSyncService::Status status = GetStatus();
// TODO(rsimha): Remove additional checks of snap->has_more_to_sync and
// snap->unsynced_count once http://crbug.com/48989 is fixed.
bool is_synced = snap &&
snap->num_blocking_conflicting_updates == 0 &&
ServiceIsPushingChanges() &&
- GetStatus().notifications_enabled &&
+ status.notifications_enabled &&
+ status.summary != sync_api::SyncManager::Status::SYNCING &&
!service()->HasUnsyncedItems() &&
!snap->has_more_to_sync &&
snap->unsynced_count == 0 &&
@@ -945,7 +947,7 @@ std::string ProfileSyncServiceHarness::GetClientInfoString(
os << profile_debug_name_ << ": " << message << ": ";
if (service()) {
const SyncSessionSnapshot* snap = GetLastSessionSnapshot();
- const ProfileSyncService::Status& status = GetStatus();
+ const ProfileSyncService::Status status = GetStatus();
if (snap) {
// Capture select info from the sync session snapshot and syncer status.
os << "has_more_to_sync: "