| Index: content/browser/download/download_manager_impl_unittest.cc
|
| diff --git a/content/browser/download/download_manager_impl_unittest.cc b/content/browser/download/download_manager_impl_unittest.cc
|
| index c9a225cf121157c2590791185594bb4c07e7764b..d13298fda7d2d7b08cc045077987eac5fe947efc 100644
|
| --- a/content/browser/download/download_manager_impl_unittest.cc
|
| +++ b/content/browser/download/download_manager_impl_unittest.cc
|
| @@ -32,6 +32,7 @@
|
| #include "content/browser/download/download_item_impl_delegate.h"
|
| #include "content/browser/download/download_request_handle.h"
|
| #include "content/browser/download/mock_download_file.h"
|
| +#include "content/browser/download/mock_download_item_impl.h"
|
| #include "content/public/browser/browser_context.h"
|
| #include "content/public/browser/download_interrupt_reasons.h"
|
| #include "content/public/browser/download_item.h"
|
| @@ -75,126 +76,6 @@ MATCHER_P2(DownloadCreateInfoWithDefaultPath, info, download_directory, "") {
|
| arg->default_download_directory == download_directory;
|
| }
|
|
|
| -class MockDownloadItemImpl : public DownloadItemImpl {
|
| - public:
|
| - // Use history constructor for minimal base object.
|
| - explicit MockDownloadItemImpl(DownloadItemImplDelegate* delegate)
|
| - : DownloadItemImpl(delegate,
|
| - std::string("7d122682-55b5-4a47-a253-36cadc3e5bee"),
|
| - content::DownloadItem::kInvalidId,
|
| - base::FilePath(),
|
| - base::FilePath(),
|
| - std::vector<GURL>(),
|
| - GURL(),
|
| - GURL(),
|
| - GURL(),
|
| - GURL(),
|
| - "application/octet-stream",
|
| - "application/octet-stream",
|
| - base::Time(),
|
| - base::Time(),
|
| - std::string(),
|
| - std::string(),
|
| - 0,
|
| - 0,
|
| - std::string(),
|
| - DownloadItem::COMPLETE,
|
| - DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
|
| - DOWNLOAD_INTERRUPT_REASON_NONE,
|
| - false,
|
| - std::vector<DownloadItem::ReceivedSlice>(),
|
| - net::NetLogWithSource()) {}
|
| - virtual ~MockDownloadItemImpl() {}
|
| -
|
| - MOCK_METHOD4(OnDownloadTargetDetermined,
|
| - void(const base::FilePath&, TargetDisposition,
|
| - DownloadDangerType, const base::FilePath&));
|
| - MOCK_METHOD1(AddObserver, void(DownloadItem::Observer*));
|
| - MOCK_METHOD1(RemoveObserver, void(DownloadItem::Observer*));
|
| - MOCK_METHOD0(UpdateObservers, void());
|
| - MOCK_METHOD0(CanShowInFolder, bool());
|
| - MOCK_METHOD0(CanOpenDownload, bool());
|
| - MOCK_METHOD0(ShouldOpenFileBasedOnExtension, bool());
|
| - MOCK_METHOD0(OpenDownload, void());
|
| - MOCK_METHOD0(ShowDownloadInShell, void());
|
| - MOCK_METHOD0(ValidateDangerousDownload, void());
|
| - MOCK_METHOD2(StealDangerousDownload, void(bool, const AcquireFileCallback&));
|
| - MOCK_METHOD3(UpdateProgress, void(int64_t, int64_t, const std::string&));
|
| - MOCK_METHOD1(Cancel, void(bool));
|
| - MOCK_METHOD0(MarkAsComplete, void());
|
| - void OnAllDataSaved(int64_t, std::unique_ptr<crypto::SecureHash>) override {
|
| - NOTREACHED();
|
| - }
|
| - MOCK_METHOD0(OnDownloadedFileRemoved, void());
|
| - void Start(std::unique_ptr<DownloadFile> download_file,
|
| - std::unique_ptr<DownloadRequestHandleInterface> req_handle,
|
| - const DownloadCreateInfo& create_info) override {
|
| - MockStart(download_file.get(), req_handle.get());
|
| - }
|
| -
|
| - MOCK_METHOD2(MockStart, void(DownloadFile*, DownloadRequestHandleInterface*));
|
| -
|
| - MOCK_METHOD0(Remove, void());
|
| - MOCK_CONST_METHOD1(TimeRemaining, bool(base::TimeDelta*));
|
| - MOCK_CONST_METHOD0(CurrentSpeed, int64_t());
|
| - MOCK_CONST_METHOD0(PercentComplete, int());
|
| - MOCK_CONST_METHOD0(AllDataSaved, bool());
|
| - MOCK_CONST_METHOD1(MatchesQuery, bool(const base::string16& query));
|
| - MOCK_CONST_METHOD0(IsDone, bool());
|
| - MOCK_CONST_METHOD0(GetFullPath, const base::FilePath&());
|
| - MOCK_CONST_METHOD0(GetTargetFilePath, const base::FilePath&());
|
| - MOCK_CONST_METHOD0(GetTargetDisposition, TargetDisposition());
|
| - MOCK_METHOD1(OnContentCheckCompleted, void(DownloadDangerType));
|
| - MOCK_CONST_METHOD0(GetState, DownloadState());
|
| - MOCK_CONST_METHOD0(GetUrlChain, const std::vector<GURL>&());
|
| - MOCK_METHOD1(SetTotalBytes, void(int64_t));
|
| - MOCK_CONST_METHOD0(GetURL, const GURL&());
|
| - MOCK_CONST_METHOD0(GetOriginalUrl, const GURL&());
|
| - MOCK_CONST_METHOD0(GetReferrerUrl, const GURL&());
|
| - MOCK_CONST_METHOD0(GetTabUrl, const GURL&());
|
| - MOCK_CONST_METHOD0(GetTabReferrerUrl, const GURL&());
|
| - MOCK_CONST_METHOD0(GetSuggestedFilename, std::string());
|
| - MOCK_CONST_METHOD0(GetContentDisposition, std::string());
|
| - MOCK_CONST_METHOD0(GetMimeType, std::string());
|
| - MOCK_CONST_METHOD0(GetOriginalMimeType, std::string());
|
| - MOCK_CONST_METHOD0(GetReferrerCharset, std::string());
|
| - MOCK_CONST_METHOD0(GetRemoteAddress, std::string());
|
| - MOCK_CONST_METHOD0(GetTotalBytes, int64_t());
|
| - MOCK_CONST_METHOD0(GetReceivedBytes, int64_t());
|
| - MOCK_CONST_METHOD0(GetHashState, const std::string&());
|
| - MOCK_CONST_METHOD0(GetHash, const std::string&());
|
| - MOCK_CONST_METHOD0(GetId, uint32_t());
|
| - MOCK_CONST_METHOD0(GetGuid, const std::string&());
|
| - MOCK_CONST_METHOD0(GetStartTime, base::Time());
|
| - MOCK_CONST_METHOD0(GetEndTime, base::Time());
|
| - MOCK_METHOD0(GetDownloadManager, DownloadManager*());
|
| - MOCK_CONST_METHOD0(IsPaused, bool());
|
| - MOCK_CONST_METHOD0(GetOpenWhenComplete, bool());
|
| - MOCK_METHOD1(SetOpenWhenComplete, void(bool));
|
| - MOCK_CONST_METHOD0(GetFileExternallyRemoved, bool());
|
| - MOCK_CONST_METHOD0(GetDangerType, DownloadDangerType());
|
| - MOCK_CONST_METHOD0(IsDangerous, bool());
|
| - MOCK_METHOD0(GetAutoOpened, bool());
|
| - MOCK_CONST_METHOD0(GetForcedFilePath, const base::FilePath&());
|
| - MOCK_CONST_METHOD0(HasUserGesture, bool());
|
| - MOCK_CONST_METHOD0(GetTransitionType, ui::PageTransition());
|
| - MOCK_CONST_METHOD0(IsTemporary, bool());
|
| - MOCK_METHOD1(SetOpened, void(bool));
|
| - MOCK_CONST_METHOD0(GetOpened, bool());
|
| - MOCK_CONST_METHOD0(GetLastModifiedTime, const std::string&());
|
| - MOCK_CONST_METHOD0(GetETag, const std::string&());
|
| - MOCK_CONST_METHOD0(GetLastReason, DownloadInterruptReason());
|
| - MOCK_CONST_METHOD0(GetBrowserContext, BrowserContext*());
|
| - MOCK_CONST_METHOD0(GetWebContents, WebContents*());
|
| - MOCK_CONST_METHOD0(GetFileNameToReportUser, base::FilePath());
|
| - MOCK_METHOD1(SetDisplayName, void(const base::FilePath&));
|
| - MOCK_METHOD0(NotifyRemoved, void());
|
| - // May be called when vlog is on.
|
| - std::string DebugString(bool verbose) const override {
|
| - return std::string();
|
| - }
|
| -};
|
| -
|
| class MockDownloadManagerDelegate : public DownloadManagerDelegate {
|
| public:
|
| MockDownloadManagerDelegate();
|
|
|