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

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..fb03393b4b78d89425c9fdeab7393e6a86e12690 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -381,6 +381,15 @@ bool ProfileSyncServiceHarness::RunStateChangeMachine() {
}
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) {
Raghu Simha 2011/09/16 04:01:02 Add a comment here that briefly explains why we ar
lipalani1 2011/09/19 18:59:13 Done.
+ SignalStateCompleteWithNextState(WAITING_FOR_NOTHING);
+ }
+ break;
+ }
case SERVER_UNREACHABLE: {
VLOG(1) << GetClientInfoString("SERVER_UNREACHABLE");
if (GetStatus().server_reachable) {
@@ -582,6 +591,18 @@ bool ProfileSyncServiceHarness::AwaitExponentialBackoffVerification() {
return (retry_verifier_.Succeeded());
}
+bool ProfileSyncServiceHarness::AwaitActionableError() {
+ ProfileSyncService::Status status = GetStatus();
+ DCHECK(status.sync_protocol_error.action == browser_sync::UNKNOWN_ACTION);
Raghu Simha 2011/09/16 04:01:02 DCHECKs won't get executed on the main waterfall,
lipalani1 2011/09/19 18:59:13 Done.
+ wait_state_ = WAITING_FOR_ACTIONABLE_ERROR;
+ AwaitStatusChangeWithTimeout(kLiveSyncOperationTimeoutMs,
+ "Waiting for actionable error");
+ status = GetStatus();
+ return (status.sync_protocol_error.action != browser_sync::UNKNOWN_ACTION &&
+ status.summary ==
+ browser_sync::SyncBackendHost::Status::OFFLINE_UNUSABLE);
Raghu Simha 2011/09/16 04:01:02 Curious: This success conditions here seem to be d
lipalani1 2011/09/19 18:59:13 Checking for unrecoverable error is the right thin
+}
+
bool ProfileSyncServiceHarness::AwaitMigration(
const syncable::ModelTypeSet& expected_migrated_types) {
VLOG(1) << GetClientInfoString("AwaitMigration");

Powered by Google App Engine
This is Rietveld 408576698