diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-10 23:57:57 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-10 23:57:57 +0000 |
commit | 866d04490b7479cc6d8553de9c1f5d15bf5bfa6b (patch) | |
tree | c692cdc2fe55ecad364fb8faa27ff4629f31b499 /sync/engine/backoff_delay_provider_unittest.cc | |
parent | 49fbef9e739a9d0ea1c4f1f83e0eec1aee57fb9b (diff) | |
download | chromium_src-866d04490b7479cc6d8553de9c1f5d15bf5bfa6b.zip chromium_src-866d04490b7479cc6d8553de9c1f5d15bf5bfa6b.tar.gz chromium_src-866d04490b7479cc6d8553de9c1f5d15bf5bfa6b.tar.bz2 |
[Sync] Add support for retrying a getupdates due to a context change
We detect a context conflict using the version value, and if detected force the
getupdates to retry.
BUG=360280
Review URL: https://codereview.chromium.org/232003005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263134 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/engine/backoff_delay_provider_unittest.cc')
-rw-r--r-- | sync/engine/backoff_delay_provider_unittest.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sync/engine/backoff_delay_provider_unittest.cc b/sync/engine/backoff_delay_provider_unittest.cc index 1bf17cb..2e58186 100644 --- a/sync/engine/backoff_delay_provider_unittest.cc +++ b/sync/engine/backoff_delay_provider_unittest.cc @@ -57,6 +57,10 @@ TEST_F(BackoffDelayProviderTest, GetInitialDelay) { EXPECT_EQ(kInitialBackoffRetrySeconds, delay->GetInitialDelay(state).InSeconds()); + state.last_download_updates_result = DATATYPE_TRIGGERED_RETRY; + EXPECT_EQ(kInitialBackoffImmediateRetrySeconds, + delay->GetInitialDelay(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 @@ -99,6 +103,10 @@ TEST_F(BackoffDelayProviderTest, GetInitialDelayWithOverride) { EXPECT_EQ(kInitialBackoffShortRetrySeconds, delay->GetInitialDelay(state).InSeconds()); + state.last_download_updates_result = DATATYPE_TRIGGERED_RETRY; + EXPECT_EQ(kInitialBackoffImmediateRetrySeconds, + delay->GetInitialDelay(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 |