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

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: Upload before commit. 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 1caa66d841eb83e336652f74078a69cad612db26..0263557d29147a81d0b6714ce6014e6da29cf329 100644
--- a/chrome/browser/sync/profile_sync_service_harness.cc
+++ b/chrome/browser/sync/profile_sync_service_harness.cc
@@ -363,13 +363,16 @@ bool ProfileSyncServiceHarness::RunStateChangeMachine() {
GetLastSessionSnapshot();
CHECK(snap);
retry_verifier_.VerifyRetryInterval(*snap);
- if (retry_verifier_.done())
+ if (retry_verifier_.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()) {
+ // There are pending migrations. Wait for them.
SignalStateCompleteWithNextState(WAITING_FOR_MIGRATION_TO_FINISH);
}
break;
@@ -377,6 +380,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 +596,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");
« no previous file with comments | « chrome/browser/sync/profile_sync_service_harness.h ('k') | chrome/browser/sync/test/integration/sync_errors_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698