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

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

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: Added binary files based on c#37 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
Index: content/public/test/mock_download_manager.h
diff --git a/content/public/test/mock_download_manager.h b/content/public/test/mock_download_manager.h
index 82c2858fa5675562b318107df182b61bce1c045b..0121352b88db6195e8a33c5875c50a79948950f1 100644
--- a/content/public/test/mock_download_manager.h
+++ b/content/public/test/mock_download_manager.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_PUBLIC_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_
#define CONTENT_PUBLIC_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_
+#include <vector>
+
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_save_info.h"
#include "content/public/browser/download_url_parameters.h"
@@ -48,16 +50,42 @@ class MockDownloadManager : public DownloadManager {
}
MOCK_METHOD1(AddObserver, void(Observer* observer));
MOCK_METHOD1(RemoveObserver, void(Observer* observer));
- MOCK_METHOD9(CreateDownloadItem, DownloadItem*(
- const FilePath& path,
- const GURL& url,
+
+ // Redirects to mock methods to get around gmock 10 argument limit.
+ // Note that this relies on the combination of target_path and url_chain
+ // to be unique on a per download item basis for any given test to
+ // allow expectations to stack.
+ virtual DownloadItem* 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) OVERRIDE;
+
+ MOCK_METHOD10(MockCreateDownloadItem1, void(
+ const FilePath& current_path,
+ const FilePath& target_path,
+ const std::vector<GURL>& url_chain,
const GURL& referrer_url,
const base::Time& start_tiem,
const base::Time& end_time,
int64 received_bytes,
int64 total_bytes,
DownloadItem::DownloadState state,
+ DownloadDangerType danger_type));
+ MOCK_METHOD4(MockCreateDownloadItem2, DownloadItem*(
+ const FilePath& target_path,
+ const std::vector<GURL>& url_chain,
+ DownloadInterruptReason interrupt_reason,
bool opened));
+
MOCK_METHOD2(OnItemAddedToPersistentStore, void(int32 download_id,
int64 db_handle));
MOCK_CONST_METHOD0(InProgressCount, int());

Powered by Google App Engine
This is Rietveld 408576698