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

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

Issue 1781983002: [Downloads] Introduce GUIDs for downloads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/mock_download_manager.cc
diff --git a/content/public/test/mock_download_manager.cc b/content/public/test/mock_download_manager.cc
index 7e477f0567190eb69ace4a33f2c7a0f06ee2d142..dc5090792f3e86e79a53feecc4dc55f5ce316d86 100644
--- a/content/public/test/mock_download_manager.cc
+++ b/content/public/test/mock_download_manager.cc
@@ -10,6 +10,7 @@
namespace content {
MockDownloadManager::CreateDownloadItemAdapter::CreateDownloadItemAdapter(
+ const std::string& guid,
uint32_t id,
const base::FilePath& current_path,
const base::FilePath& target_path,
@@ -27,7 +28,8 @@ MockDownloadManager::CreateDownloadItemAdapter::CreateDownloadItemAdapter(
DownloadDangerType danger_type,
DownloadInterruptReason interrupt_reason,
bool opened)
- : id(id),
+ : guid(guid),
+ id(id),
current_path(current_path),
target_path(target_path),
url_chain(url_chain),
@@ -45,7 +47,8 @@ MockDownloadManager::CreateDownloadItemAdapter::CreateDownloadItemAdapter(
MockDownloadManager::CreateDownloadItemAdapter::CreateDownloadItemAdapter(
const CreateDownloadItemAdapter& rhs)
- : id(rhs.id),
+ : guid(rhs.guid),
+ id(rhs.id),
current_path(rhs.current_path),
target_path(rhs.target_path),
url_chain(rhs.url_chain),
@@ -65,23 +68,16 @@ MockDownloadManager::CreateDownloadItemAdapter::~CreateDownloadItemAdapter() {}
bool MockDownloadManager::CreateDownloadItemAdapter::operator==(
const CreateDownloadItemAdapter& rhs) const {
- return (id == rhs.id &&
- current_path == rhs.current_path &&
- target_path == rhs.target_path &&
- url_chain == rhs.url_chain &&
- referrer_url == rhs.referrer_url &&
- mime_type == rhs.mime_type &&
- original_mime_type == rhs.original_mime_type &&
- start_time == rhs.start_time &&
- end_time == rhs.end_time &&
- etag == rhs.etag &&
- last_modified == rhs.last_modified &&
- 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);
+ return (
+ guid == rhs.guid && id == rhs.id && current_path == rhs.current_path &&
+ target_path == rhs.target_path && url_chain == rhs.url_chain &&
+ referrer_url == rhs.referrer_url && mime_type == rhs.mime_type &&
+ original_mime_type == rhs.original_mime_type &&
+ start_time == rhs.start_time && end_time == rhs.end_time &&
+ etag == rhs.etag && last_modified == rhs.last_modified &&
+ 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::MockDownloadManager() {}
@@ -96,6 +92,7 @@ void MockDownloadManager::StartDownload(
}
DownloadItem* MockDownloadManager::CreateDownloadItem(
+ const std::string& guid,
uint32_t id,
const base::FilePath& current_path,
const base::FilePath& target_path,
@@ -114,7 +111,7 @@ DownloadItem* MockDownloadManager::CreateDownloadItem(
DownloadInterruptReason interrupt_reason,
bool opened) {
CreateDownloadItemAdapter adapter(
- id, current_path, target_path, url_chain, referrer_url, mime_type,
+ guid, id, current_path, target_path, url_chain, referrer_url, mime_type,
original_mime_type, start_time, end_time, etag, last_modified,
received_bytes, total_bytes, state, danger_type, interrupt_reason,
opened);

Powered by Google App Engine
This is Rietveld 408576698