| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_TEST_MOCK_DOWNLOAD_ITEM_H_ | |
| 6 #define CONTENT_TEST_MOCK_DOWNLOAD_ITEM_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "content/public/browser/download_id.h" | |
| 12 #include "content/public/browser/download_interrupt_reasons.h" | |
| 13 #include "content/public/browser/download_item.h" | |
| 14 #include "content/public/browser/download_persistent_store_info.h" | |
| 15 #include "testing/gmock/include/gmock/gmock.h" | |
| 16 #include "testing/gtest/include/gtest/gtest.h" | |
| 17 | |
| 18 namespace content { | |
| 19 | |
| 20 class MockDownloadItem : public content::DownloadItem { | |
| 21 public: | |
| 22 MockDownloadItem(); | |
| 23 virtual ~MockDownloadItem(); | |
| 24 MOCK_METHOD1(AddObserver, void(content::DownloadItem::Observer*)); | |
| 25 MOCK_METHOD1(RemoveObserver, void(content::DownloadItem::Observer*)); | |
| 26 MOCK_METHOD0(UpdateObservers, void()); | |
| 27 MOCK_METHOD0(CanShowInFolder, bool()); | |
| 28 MOCK_METHOD0(CanOpenDownload, bool()); | |
| 29 MOCK_METHOD0(ShouldOpenFileBasedOnExtension, bool()); | |
| 30 MOCK_METHOD0(OpenDownload, void()); | |
| 31 MOCK_METHOD0(ShowDownloadInShell, void()); | |
| 32 MOCK_METHOD0(DangerousDownloadValidated, void()); | |
| 33 MOCK_METHOD3(UpdateProgress, void(int64, int64, const std::string&)); | |
| 34 MOCK_METHOD1(Cancel, void(bool)); | |
| 35 MOCK_METHOD0(MarkAsComplete, void()); | |
| 36 MOCK_METHOD0(DelayedDownloadOpened, void()); | |
| 37 MOCK_METHOD2(OnAllDataSaved, void(int64, const std::string&)); | |
| 38 MOCK_METHOD0(OnDownloadedFileRemoved, void()); | |
| 39 MOCK_METHOD0(MaybeCompleteDownload, void()); | |
| 40 MOCK_METHOD3(Interrupted, void(int64, | |
| 41 const std::string&, | |
| 42 DownloadInterruptReason)); | |
| 43 MOCK_METHOD1(Delete, void(DeleteReason)); | |
| 44 MOCK_METHOD0(Remove, void()); | |
| 45 MOCK_CONST_METHOD1(TimeRemaining, bool(base::TimeDelta*)); | |
| 46 MOCK_CONST_METHOD0(CurrentSpeed, int64()); | |
| 47 MOCK_CONST_METHOD0(PercentComplete, int()); | |
| 48 MOCK_CONST_METHOD0(AllDataSaved, bool()); | |
| 49 MOCK_METHOD0(TogglePause, void()); | |
| 50 MOCK_METHOD1(OnDownloadCompleting, void(DownloadFileManager*)); | |
| 51 MOCK_CONST_METHOD1(MatchesQuery, bool(const string16& query)); | |
| 52 MOCK_CONST_METHOD0(IsPartialDownload, bool()); | |
| 53 MOCK_CONST_METHOD0(IsInProgress, bool()); | |
| 54 MOCK_CONST_METHOD0(IsCancelled, bool()); | |
| 55 MOCK_CONST_METHOD0(IsInterrupted, bool()); | |
| 56 MOCK_CONST_METHOD0(IsComplete, bool()); | |
| 57 MOCK_CONST_METHOD0(GetFullPath, const FilePath&()); | |
| 58 MOCK_CONST_METHOD0(GetTargetFilePath, const FilePath&()); | |
| 59 MOCK_CONST_METHOD0(GetTargetDisposition, TargetDisposition()); | |
| 60 MOCK_METHOD3(OnTargetPathDetermined, void(const FilePath&, | |
| 61 TargetDisposition, | |
| 62 content::DownloadDangerType)); | |
| 63 MOCK_METHOD1(OnTargetPathSelected, void(const FilePath&)); | |
| 64 MOCK_METHOD1(OnContentCheckCompleted, void(content::DownloadDangerType)); | |
| 65 MOCK_METHOD3(OnIntermediatePathDetermined, void(DownloadFileManager*, | |
| 66 const FilePath&, | |
| 67 bool)); | |
| 68 MOCK_CONST_METHOD0(GetState, DownloadState()); | |
| 69 MOCK_CONST_METHOD0(GetUrlChain, const std::vector<GURL>&()); | |
| 70 MOCK_METHOD1(SetTotalBytes, void(int64)); | |
| 71 MOCK_CONST_METHOD0(GetURL, const GURL&()); | |
| 72 MOCK_CONST_METHOD0(GetOriginalUrl, const GURL&()); | |
| 73 MOCK_CONST_METHOD0(GetReferrerUrl, const GURL&()); | |
| 74 MOCK_CONST_METHOD0(GetSuggestedFilename, std::string()); | |
| 75 MOCK_CONST_METHOD0(GetContentDisposition, std::string()); | |
| 76 MOCK_CONST_METHOD0(GetMimeType, std::string()); | |
| 77 MOCK_CONST_METHOD0(GetOriginalMimeType, std::string()); | |
| 78 MOCK_CONST_METHOD0(GetReferrerCharset, std::string()); | |
| 79 MOCK_CONST_METHOD0(GetRemoteAddress, std::string()); | |
| 80 MOCK_CONST_METHOD0(GetTotalBytes, int64()); | |
| 81 MOCK_CONST_METHOD0(GetReceivedBytes, int64()); | |
| 82 MOCK_CONST_METHOD0(GetHashState, const std::string&()); | |
| 83 MOCK_CONST_METHOD0(GetHash, const std::string&()); | |
| 84 MOCK_CONST_METHOD0(GetId, int32()); | |
| 85 MOCK_CONST_METHOD0(GetGlobalId, content::DownloadId()); | |
| 86 MOCK_CONST_METHOD0(GetStartTime, base::Time()); | |
| 87 MOCK_CONST_METHOD0(GetEndTime, base::Time()); | |
| 88 MOCK_METHOD0(SetIsPersisted, void()); | |
| 89 MOCK_CONST_METHOD0(IsPersisted, bool()); | |
| 90 MOCK_METHOD1(SetDbHandle, void(int64)); | |
| 91 MOCK_CONST_METHOD0(GetDbHandle, int64()); | |
| 92 MOCK_METHOD0(GetDownloadManager, content::DownloadManager*()); | |
| 93 MOCK_CONST_METHOD0(IsPaused, bool()); | |
| 94 MOCK_CONST_METHOD0(GetOpenWhenComplete, bool()); | |
| 95 MOCK_METHOD1(SetOpenWhenComplete, void(bool)); | |
| 96 MOCK_CONST_METHOD0(GetFileExternallyRemoved, bool()); | |
| 97 MOCK_CONST_METHOD0(GetSafetyState, SafetyState()); | |
| 98 MOCK_CONST_METHOD0(GetDangerType, content::DownloadDangerType()); | |
| 99 MOCK_CONST_METHOD0(IsDangerous, bool()); | |
| 100 MOCK_METHOD0(GetAutoOpened, bool()); | |
| 101 MOCK_CONST_METHOD0(GetTargetName, FilePath()); | |
| 102 MOCK_CONST_METHOD0(GetForcedFilePath, const FilePath&()); | |
| 103 MOCK_CONST_METHOD0(HasUserGesture, bool()); | |
| 104 MOCK_CONST_METHOD0(GetTransitionType, content::PageTransition()); | |
| 105 MOCK_CONST_METHOD0(IsOtr, bool()); | |
| 106 MOCK_CONST_METHOD0(IsTemporary, bool()); | |
| 107 MOCK_METHOD1(SetIsTemporary, void(bool)); | |
| 108 MOCK_METHOD1(SetOpened, void(bool)); | |
| 109 MOCK_CONST_METHOD0(GetOpened, bool()); | |
| 110 MOCK_CONST_METHOD0(GetLastModifiedTime, const std::string&()); | |
| 111 MOCK_CONST_METHOD0(GetETag, const std::string&()); | |
| 112 MOCK_CONST_METHOD0(GetLastReason, DownloadInterruptReason()); | |
| 113 MOCK_CONST_METHOD0(GetPersistentStoreInfo, DownloadPersistentStoreInfo()); | |
| 114 MOCK_CONST_METHOD0(GetBrowserContext, content::BrowserContext*()); | |
| 115 MOCK_CONST_METHOD0(GetWebContents, content::WebContents*()); | |
| 116 MOCK_CONST_METHOD0(GetFileNameToReportUser, FilePath()); | |
| 117 MOCK_METHOD1(SetDisplayName, void(const FilePath&)); | |
| 118 MOCK_CONST_METHOD0(GetUserVerifiedFilePath, FilePath()); | |
| 119 MOCK_METHOD1(OffThreadCancel, void(DownloadFileManager* file_manager)); | |
| 120 MOCK_CONST_METHOD1(DebugString, std::string(bool)); | |
| 121 MOCK_METHOD0(MockDownloadOpenForTesting, void()); | |
| 122 MOCK_METHOD1(GetExternalData, ExternalData*(const void*)); | |
| 123 MOCK_CONST_METHOD1(GetExternalData, const ExternalData*(const void*)); | |
| 124 MOCK_METHOD2(SetExternalData, void(const void*, ExternalData*)); | |
| 125 }; | |
| 126 | |
| 127 } // namespace content | |
| 128 | |
| 129 #endif // CONTENT_TEST_MOCK_DOWNLOAD_ITEM_H_ | |
| OLD | NEW |