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

Unified Diff: content/public/test/mock_download_manager.cc

Issue 11363222: Persist download interrupt reason, both target and current paths, and url_chain. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged to r180302 Created 7 years, 11 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
« no previous file with comments | « content/public/test/mock_download_manager.h ('k') | content/test/net/url_request_slow_download_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/mock_download_manager.cc
diff --git a/content/public/test/mock_download_manager.cc b/content/public/test/mock_download_manager.cc
index 64349fdfcba4c713b01c15f8d6903f855dd97f52..a3b9615bb9550a6133a90d1cdbe2fe84a0f9c806 100644
--- a/content/public/test/mock_download_manager.cc
+++ b/content/public/test/mock_download_manager.cc
@@ -9,7 +9,63 @@
namespace content {
-void PrintTo(const DownloadRequestHandle& params, std::ostream* os) {
+MockDownloadManager::CreateDownloadItemAdapter::CreateDownloadItemAdapter(
+ const FilePath& current_path,
+ const FilePath& target_path,
+ const std::vector<GURL>& url_chain,
+ const GURL& referrer_url,
+ const base::Time& start_time,
+ const base::Time& end_time,
+ int64 received_bytes,
+ int64 total_bytes,
+ DownloadItem::DownloadState state,
+ DownloadDangerType danger_type,
+ DownloadInterruptReason interrupt_reason,
+ bool opened)
+ : current_path(current_path),
+ target_path(target_path),
+ url_chain(url_chain),
+ referrer_url(referrer_url),
+ start_time(start_time),
+ end_time(end_time),
+ received_bytes(received_bytes),
+ total_bytes(total_bytes),
+ state(state),
+ danger_type(danger_type),
+ interrupt_reason(interrupt_reason),
+ opened(opened) {}
+
+MockDownloadManager::CreateDownloadItemAdapter::CreateDownloadItemAdapter(
+ const CreateDownloadItemAdapter& rhs)
+ : current_path(rhs.current_path),
+ target_path(rhs.target_path),
+ url_chain(rhs.url_chain),
+ referrer_url(rhs.referrer_url),
+ start_time(rhs.start_time),
+ end_time(rhs.end_time),
+ received_bytes(rhs.received_bytes),
+ total_bytes(rhs.total_bytes),
+ state(rhs.state),
+ danger_type(rhs.danger_type),
+ interrupt_reason(rhs.interrupt_reason),
+ opened(rhs.opened) {}
+
+MockDownloadManager::CreateDownloadItemAdapter::~CreateDownloadItemAdapter() {}
+
+bool MockDownloadManager::CreateDownloadItemAdapter::operator==(
+ const CreateDownloadItemAdapter& rhs) {
+ return (current_path == rhs.current_path &&
+ target_path == rhs.target_path &&
+ url_chain == rhs.url_chain &&
+ referrer_url == rhs.referrer_url &&
+ start_time == rhs.start_time &&
+ end_time == rhs.end_time &&
+ received_bytes == rhs.received_bytes &&
+ total_bytes == rhs.total_bytes &&
+ state == rhs.state &&
+ danger_type == rhs.danger_type &&
+ interrupt_reason == rhs.interrupt_reason &&
+ opened == opened);
}
MockDownloadManager::MockDownloadManager() {}
@@ -22,4 +78,24 @@ DownloadItem* MockDownloadManager::StartDownload(
return MockStartDownload(info.get(), stream.get());
}
+DownloadItem* MockDownloadManager::CreateDownloadItem(
+ const FilePath& current_path,
+ const FilePath& target_path,
+ const std::vector<GURL>& url_chain,
+ const GURL& referrer_url,
+ const base::Time& start_time,
+ const base::Time& end_time,
+ int64 received_bytes,
+ int64 total_bytes,
+ DownloadItem::DownloadState state,
+ DownloadDangerType danger_type,
+ DownloadInterruptReason interrupt_reason,
+ bool opened) {
+ CreateDownloadItemAdapter adapter(
+ current_path, target_path, url_chain, referrer_url, start_time,
+ end_time, received_bytes, total_bytes, state, danger_type,
+ interrupt_reason, opened);
+ return MockCreateDownloadItem(adapter);
+}
+
} // namespace content
« no previous file with comments | « content/public/test/mock_download_manager.h ('k') | content/test/net/url_request_slow_download_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698