| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_ITEM_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_ITEM_H_ |
| 6 #define CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_ITEM_H_ | 6 #define CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_ITEM_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // OnDownloadDestroyed() notification when the mock is destroyed. | 28 // OnDownloadDestroyed() notification when the mock is destroyed. |
| 29 void AddObserver(Observer* observer) override; | 29 void AddObserver(Observer* observer) override; |
| 30 void RemoveObserver(Observer* observer) override; | 30 void RemoveObserver(Observer* observer) override; |
| 31 | 31 |
| 32 // Dispatches an OnDownloadOpened() notification to observers. | 32 // Dispatches an OnDownloadOpened() notification to observers. |
| 33 void NotifyObserversDownloadOpened(); | 33 void NotifyObserversDownloadOpened(); |
| 34 // Dispatches an OnDownloadRemoved() notification to observers. | 34 // Dispatches an OnDownloadRemoved() notification to observers. |
| 35 void NotifyObserversDownloadRemoved(); | 35 void NotifyObserversDownloadRemoved(); |
| 36 // Dispatches an OnDownloadUpdated() notification to observers. | 36 // Dispatches an OnDownloadUpdated() notification to observers. |
| 37 void NotifyObserversDownloadUpdated(); | 37 void NotifyObserversDownloadUpdated(); |
| 38 // Dispatches an OnDownloadShown() notification to observers. |
| 39 void NotifyObserversDownloadShown(); |
| 38 | 40 |
| 39 MOCK_METHOD0(UpdateObservers, void()); | 41 MOCK_METHOD0(UpdateObservers, void()); |
| 40 MOCK_METHOD0(ValidateDangerousDownload, void()); | 42 MOCK_METHOD0(ValidateDangerousDownload, void()); |
| 41 MOCK_METHOD1(StealDangerousDownload, void(const AcquireFileCallback&)); | 43 MOCK_METHOD1(StealDangerousDownload, void(const AcquireFileCallback&)); |
| 42 MOCK_METHOD0(Pause, void()); | 44 MOCK_METHOD0(Pause, void()); |
| 43 MOCK_METHOD0(Resume, void()); | 45 MOCK_METHOD0(Resume, void()); |
| 44 MOCK_METHOD1(Cancel, void(bool)); | 46 MOCK_METHOD1(Cancel, void(bool)); |
| 45 MOCK_METHOD0(Remove, void()); | 47 MOCK_METHOD0(Remove, void()); |
| 46 MOCK_METHOD0(OpenDownload, void()); | 48 MOCK_METHOD0(OpenDownload, void()); |
| 47 MOCK_METHOD0(ShowDownloadInShell, void()); | 49 MOCK_METHOD0(ShowDownloadInShell, void()); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 MOCK_METHOD0(CanShowInFolder, bool()); | 95 MOCK_METHOD0(CanShowInFolder, bool()); |
| 94 MOCK_METHOD0(CanOpenDownload, bool()); | 96 MOCK_METHOD0(CanOpenDownload, bool()); |
| 95 MOCK_METHOD0(ShouldOpenFileBasedOnExtension, bool()); | 97 MOCK_METHOD0(ShouldOpenFileBasedOnExtension, bool()); |
| 96 MOCK_CONST_METHOD0(GetOpenWhenComplete, bool()); | 98 MOCK_CONST_METHOD0(GetOpenWhenComplete, bool()); |
| 97 MOCK_METHOD0(GetAutoOpened, bool()); | 99 MOCK_METHOD0(GetAutoOpened, bool()); |
| 98 MOCK_CONST_METHOD0(GetOpened, bool()); | 100 MOCK_CONST_METHOD0(GetOpened, bool()); |
| 99 MOCK_CONST_METHOD0(GetBrowserContext, BrowserContext*()); | 101 MOCK_CONST_METHOD0(GetBrowserContext, BrowserContext*()); |
| 100 MOCK_CONST_METHOD0(GetWebContents, WebContents*()); | 102 MOCK_CONST_METHOD0(GetWebContents, WebContents*()); |
| 101 MOCK_METHOD1(OnContentCheckCompleted, void(DownloadDangerType)); | 103 MOCK_METHOD1(OnContentCheckCompleted, void(DownloadDangerType)); |
| 102 MOCK_METHOD1(SetOpenWhenComplete, void(bool)); | 104 MOCK_METHOD1(SetOpenWhenComplete, void(bool)); |
| 103 MOCK_METHOD1(SetOpened, void(bool)); | |
| 104 MOCK_METHOD1(SetDisplayName, void(const base::FilePath&)); | 105 MOCK_METHOD1(SetDisplayName, void(const base::FilePath&)); |
| 105 MOCK_CONST_METHOD1(DebugString, std::string(bool)); | 106 MOCK_CONST_METHOD1(DebugString, std::string(bool)); |
| 106 | 107 |
| 107 private: | 108 private: |
| 108 base::ObserverList<Observer> observers_; | 109 base::ObserverList<Observer> observers_; |
| 109 }; | 110 }; |
| 110 | 111 |
| 111 } // namespace content | 112 } // namespace content |
| 112 | 113 |
| 113 #endif // CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_ITEM_H_ | 114 #endif // CONTENT_PUBLIC_TEST_MOCK_DOWNLOAD_ITEM_H_ |
| OLD | NEW |