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

Unified Diff: chrome/test/live_sync/profile_sync_service_test_harness.cc

Issue 3037019: Fixing broken Integration tests. (Closed)
Patch Set: Adding periods after comments. Created 10 years, 5 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/test/live_sync/live_sync_test.h ('k') | chrome/test/live_sync/two_client_live_autofill_sync_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/live_sync/profile_sync_service_test_harness.cc
diff --git a/chrome/test/live_sync/profile_sync_service_test_harness.cc b/chrome/test/live_sync/profile_sync_service_test_harness.cc
index bd9ceab48688934e045ec0f19f7db698b86f3fe0..081b0d85440a16efed06faf505a5cc08b152f64a 100644
--- a/chrome/test/live_sync/profile_sync_service_test_harness.cc
+++ b/chrome/test/live_sync/profile_sync_service_test_harness.cc
@@ -140,7 +140,6 @@ bool ProfileSyncServiceTestHarness::RunStateChangeMachine() {
if (snap->has_more_to_sync || snap->unsynced_count != 0) {
break;
}
-
EXPECT_LE(last_timestamp_, snap->max_local_timestamp);
last_timestamp_ = snap->max_local_timestamp;
SignalStateCompleteWithNextState(FULLY_SYNCED);
@@ -149,9 +148,11 @@ bool ProfileSyncServiceTestHarness::RunStateChangeMachine() {
case WAITING_FOR_UPDATES: {
const SyncSessionSnapshot* snap = GetLastSessionSnapshot();
DCHECK(snap) << "Should have been at least one sync session by now";
- if (snap->max_local_timestamp < min_timestamp_needed_)
+ if (snap->max_local_timestamp < min_timestamp_needed_) {
break;
-
+ }
+ EXPECT_LE(last_timestamp_, snap->max_local_timestamp);
+ last_timestamp_ = snap->max_local_timestamp;
SignalStateCompleteWithNextState(FULLY_SYNCED);
break;
}
@@ -171,10 +172,18 @@ void ProfileSyncServiceTestHarness::OnStateChanged() {
bool ProfileSyncServiceTestHarness::AwaitSyncCycleCompletion(
const std::string& reason) {
- if (service()->backend()->HasUnsyncedItems()) {
+ const SyncSessionSnapshot* snap = GetLastSessionSnapshot();
+ DCHECK(snap) << "Should have been at least one sync session by now";
+ // TODO(rsimha): Remove additional checks of snap->has_more_to_sync and
+ // snap->unsynced_count once http://crbug.com/48989 is fixed.
+ if (service()->backend()->HasUnsyncedItems() ||
+ snap->has_more_to_sync ||
+ snap->unsynced_count != 0) {
wait_state_ = WAITING_FOR_SYNC_TO_FINISH;
return AwaitStatusChangeWithTimeout(60, reason);
} else {
+ EXPECT_LE(last_timestamp_, snap->max_local_timestamp);
+ last_timestamp_ = snap->max_local_timestamp;
return true;
}
}
« no previous file with comments | « chrome/test/live_sync/live_sync_test.h ('k') | chrome/test/live_sync/two_client_live_autofill_sync_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698