Chromium Code Reviews| Index: chrome/browser/chromeos/customization_wallpaper_downloader.h |
| diff --git a/chrome/browser/chromeos/customization_wallpaper_downloader.h b/chrome/browser/chromeos/customization_wallpaper_downloader.h |
| index 9922ffbdc2b9a43285784a4b985910a767735f09..90620d153ffc55026c4c460b2bad3e69c52daef3 100644 |
| --- a/chrome/browser/chromeos/customization_wallpaper_downloader.h |
| +++ b/chrome/browser/chromeos/customization_wallpaper_downloader.h |
| @@ -52,6 +52,15 @@ class CustomizationWallpaperDownloader : public net::URLFetcherDelegate { |
| // net::URLFetcherDelegate |
| virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
| + // This is called in tests to modify (lower) retry delay. |
| + void set_retry_delay_for_testing(base::TimeDelta value) { |
| + retry_delay_ = value; |
| + } |
| + |
| + base::TimeDelta get_retry_current_delay_for_testing() const { |
|
Daniel Erat
2014/05/07 00:10:33
nit: rename to retry_current_delay_for_testing() (
Alexander Alekseev
2014/05/07 00:26:08
Done.
|
| + return retry_current_delay_; |
| + } |
| + |
| private: |
| // Start new request. |
| void StartRequest(); |
| @@ -89,6 +98,13 @@ class CustomizationWallpaperDownloader : public net::URLFetcherDelegate { |
| // Number of download retries (first attempt is not counted as retry). |
| size_t retries_; |
| + // Sleep between retry requests (increasing, see Retry() method for details). |
| + // Non-constant value for tests. |
| + base::TimeDelta retry_delay_; |
| + |
| + // Retry delay of the last attempt. For testing only. |
| + base::TimeDelta retry_current_delay_; |
| + |
| // Callback supplied by caller. |
| base::Callback<void(bool success, const GURL&)> on_wallpaper_fetch_completed_; |