| Index: sync/engine/sync_scheduler_unittest.cc
|
| diff --git a/sync/engine/sync_scheduler_unittest.cc b/sync/engine/sync_scheduler_unittest.cc
|
| index 2b9ea8733ef0864bffba36e783819a88469618c1..0420bcb6c943f1c08f1706f82da2bd8e071c9417 100644
|
| --- a/sync/engine/sync_scheduler_unittest.cc
|
| +++ b/sync/engine/sync_scheduler_unittest.cc
|
| @@ -928,7 +928,7 @@ TEST_F(SyncSchedulerTest, BackoffElevation) {
|
| .WillRepeatedly(DoAll(Invoke(sessions::test_util::SimulateCommitFailed),
|
| RecordSyncShareMultiple(&r, kMinNumSamples)));
|
|
|
| - const TimeDelta first = TimeDelta::FromSeconds(1);
|
| + const TimeDelta first = TimeDelta::FromSeconds(kInitialBackoffRetrySeconds);
|
| const TimeDelta second = TimeDelta::FromMilliseconds(2);
|
| const TimeDelta third = TimeDelta::FromMilliseconds(3);
|
| const TimeDelta fourth = TimeDelta::FromMilliseconds(4);
|
| @@ -959,6 +959,38 @@ TEST_F(SyncSchedulerTest, BackoffElevation) {
|
| EXPECT_GE(r.times[4] - r.times[3], fifth);
|
| }
|
|
|
| +TEST_F(SyncSchedulerTest, GetInitialBackoffDelay) {
|
| + sessions::ModelNeutralState state;
|
| + state.last_get_key_result = SYNC_SERVER_ERROR;
|
| + EXPECT_EQ(kInitialBackoffRetrySeconds,
|
| + scheduler()->GetInitialBackoffDelay(state).InSeconds());
|
| +
|
| + state.last_get_key_result = UNSET;
|
| + state.last_download_updates_result = SERVER_RETURN_MIGRATION_DONE;
|
| + EXPECT_EQ(kInitialBackoffShortRetrySeconds,
|
| + scheduler()->GetInitialBackoffDelay(state).InSeconds());
|
| +
|
| + state.last_download_updates_result = SERVER_RETURN_TRANSIENT_ERROR;
|
| + EXPECT_EQ(kInitialBackoffRetrySeconds,
|
| + scheduler()->GetInitialBackoffDelay(state).InSeconds());
|
| +
|
| + state.last_download_updates_result = SERVER_RESPONSE_VALIDATION_FAILED;
|
| + EXPECT_EQ(kInitialBackoffRetrySeconds,
|
| + scheduler()->GetInitialBackoffDelay(state).InSeconds());
|
| +
|
| + state.last_download_updates_result = SYNCER_OK;
|
| + // Note that updating credentials triggers a canary job, trumping
|
| + // the initial delay, but in theory we still expect this function to treat
|
| + // it like any other error in the system (except migration).
|
| + state.commit_result = SERVER_RETURN_INVALID_CREDENTIAL;
|
| + EXPECT_EQ(kInitialBackoffRetrySeconds,
|
| + scheduler()->GetInitialBackoffDelay(state).InSeconds());
|
| +
|
| + state.commit_result = SERVER_RETURN_MIGRATION_DONE;
|
| + EXPECT_EQ(kInitialBackoffShortRetrySeconds,
|
| + scheduler()->GetInitialBackoffDelay(state).InSeconds());
|
| +}
|
| +
|
| // Test that things go back to normal once a retry makes forward progress.
|
| TEST_F(SyncSchedulerTest, BackoffRelief) {
|
| SyncShareRecords r;
|
|
|