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

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

Issue 7919001: test cases for server directed error handling code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 years, 3 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/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 6b09d1fb189aee887af74774bfe163c88b847976..bd8aac9b339ddccc2f18864e7aadd6a0dd3c415d 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -364,12 +364,14 @@ bool ProfileSyncServiceHarness::RunStateChangeMachine() {
CHECK(snap);
retry_verifier_.VerifyRetryInterval(*snap);
if (retry_verifier_.done())
Raghu Simha 2011/09/19 22:25:02 This if block needs to be within braces.
lipalani1 2011/09/22 20:42:46 Done.
+ // Retry verifier is done verifying exponential backoff.
SignalStateCompleteWithNextState(WAITING_FOR_NOTHING);
break;
}
case WAITING_FOR_MIGRATION_TO_START: {
VLOG(1) << GetClientInfoString("WAITING_FOR_MIGRATION_TO_START");
if (HasPendingBackendMigration()) {
+ // No pending migrations. Now on to waiting for migrations.
Raghu Simha 2011/09/19 22:25:02 How does HasPendingBackendMigration() == true indi
lipalani1 2011/09/22 20:42:46 Done.
SignalStateCompleteWithNextState(WAITING_FOR_MIGRATION_TO_FINISH);
}
break;
@@ -377,6 +379,17 @@ bool ProfileSyncServiceHarness::RunStateChangeMachine() {
case WAITING_FOR_MIGRATION_TO_FINISH: {
VLOG(1) << GetClientInfoString("WAITING_FOR_MIGRATION_TO_FINISH");
if (!HasPendingBackendMigration()) {
+ // Done migrating.
+ SignalStateCompleteWithNextState(WAITING_FOR_NOTHING);
+ }
+ break;
+ }
+ case WAITING_FOR_ACTIONABLE_ERROR: {
+ VLOG(1) << GetClientInfoString("WAITING_FOR_ACTIONABLE_ERROR");
+ ProfileSyncService::Status status = GetStatus();
+ if (status.sync_protocol_error.action != browser_sync::UNKNOWN_ACTION &&
+ service_->unrecoverable_error_detected() == true) {
+ // An actionable error has been detected.
SignalStateCompleteWithNextState(WAITING_FOR_NOTHING);
}
break;
@@ -582,6 +595,17 @@ bool ProfileSyncServiceHarness::AwaitExponentialBackoffVerification() {
return (retry_verifier_.Succeeded());
}
+bool ProfileSyncServiceHarness::AwaitActionableError() {
+ ProfileSyncService::Status status = GetStatus();
+ CHECK(status.sync_protocol_error.action == browser_sync::UNKNOWN_ACTION);
+ wait_state_ = WAITING_FOR_ACTIONABLE_ERROR;
+ AwaitStatusChangeWithTimeout(kLiveSyncOperationTimeoutMs,
+ "Waiting for actionable error");
+ status = GetStatus();
+ return (status.sync_protocol_error.action != browser_sync::UNKNOWN_ACTION &&
+ service_->unrecoverable_error_detected());
+}
+
bool ProfileSyncServiceHarness::AwaitMigration(
const syncable::ModelTypeSet& expected_migrated_types) {
VLOG(1) << GetClientInfoString("AwaitMigration");

Powered by Google App Engine
This is Rietveld 408576698