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

Unified Diff: content/public/test/fake_download_item.h

Issue 2753583002: Add the JobComplete callback and error/interrupt information (Closed)
Patch Set: added argument name Created 3 years, 9 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: content/public/test/fake_download_item.h
diff --git a/content/public/test/fake_download_item.h b/content/public/test/fake_download_item.h
index e11054a86173d9fa3c002bd0952b56f3d5f32061..cb3e789aae804dedd649f1a0c7c4ef70062cdc4c 100644
--- a/content/public/test/fake_download_item.h
+++ b/content/public/test/fake_download_item.h
@@ -66,6 +66,9 @@ class FakeDownloadItem : public DownloadItem {
void SetOriginalUrl(const GURL& url);
const GURL& GetOriginalUrl() const override;
+ void SetLastReason(DownloadInterruptReason last_reason);
+ DownloadInterruptReason GetLastReason() const override;
+
// The methods below are not supported and are not expected to be called.
void ValidateDangerousDownload() override;
void StealDangerousDownload(bool delete_file_afterward,
@@ -76,7 +79,6 @@ class FakeDownloadItem : public DownloadItem {
void Remove() override;
void OpenDownload() override;
void ShowDownloadInShell() override;
- DownloadInterruptReason GetLastReason() const override;
bool IsPaused() const override;
bool IsTemporary() const override;
bool CanResume() const override;
@@ -129,16 +131,20 @@ class FakeDownloadItem : public DownloadItem {
private:
base::ObserverList<Observer> observers_;
- uint32_t id_;
+ uint32_t id_ = 0;
std::string guid_;
GURL url_;
base::FilePath file_path_;
- bool is_file_externally_removed_;
+ bool is_file_externally_removed_ = false;
base::Time start_time_;
base::Time end_time_;
- DownloadState download_state_;
+ // MAX_DOWNLOAD_STATE is used as the uninitialized state.
+ DownloadState download_state_ =
+ DownloadItem::DownloadState::MAX_DOWNLOAD_STATE;
std::string mime_type_;
GURL original_url_;
+ DownloadInterruptReason last_reason_ =
+ DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE;
// The members below are to be returned by methods, which return by reference.
std::string dummy_string;
« no previous file with comments | « content/browser/background_fetch/background_fetch_request_info.cc ('k') | content/public/test/fake_download_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698