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

Unified Diff: chrome/browser/chromeos/customization_wallpaper_downloader.h

Issue 253833006: Add browser test for CustomizationWallpaperDownloader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implemented set_retry_delay_for_testing. Created 6 years, 8 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/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..fb9be1eda3d0904a01689de7d4a08064a0bc3098 100644
--- a/chrome/browser/chromeos/customization_wallpaper_downloader.h
+++ b/chrome/browser/chromeos/customization_wallpaper_downloader.h
@@ -53,6 +53,14 @@ class CustomizationWallpaperDownloader : public net::URLFetcherDelegate {
virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
private:
+ // This class is used in tests.
+ friend class TestWallpaperImageURLFetcherCallback;
+
+ // This is called in tests to modify (lower) retry delay.
+ void set_retry_delay_for_testing(double value) {
Daniel Erat 2014/04/30 21:23:06 leave this as public; there's a presubmit check th
Alexander Alekseev 2014/05/04 23:30:56 Done.
+ retry_delay_seconds_ = value;
+ }
+
// Start new request.
void StartRequest();
@@ -89,6 +97,10 @@ 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.
+ double retry_delay_seconds_;
Daniel Erat 2014/04/30 21:23:06 base::TimeDelta
Alexander Alekseev 2014/05/04 23:30:56 Done.
+
// Callback supplied by caller.
base::Callback<void(bool success, const GURL&)> on_wallpaper_fetch_completed_;

Powered by Google App Engine
This is Rietveld 408576698