| 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_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "content/browser/download/download_request_handle.h" | 9 #include "content/browser/download/download_request_handle.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/public/browser/download_item.h" | 11 #include "content/public/browser/download_item.h" |
| 12 #include "content/public/browser/download_manager.h" | 12 #include "content/public/browser/download_manager.h" |
| 13 #include "content/public/browser/download_save_info.h" | 13 #include "content/public/browser/download_save_info.h" |
| 14 #include "content/public/browser/download_url_parameters.h" |
| 14 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 15 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 18 |
| 18 namespace content { | 19 namespace content { |
| 19 | 20 |
| 20 class MockDownloadManager : public content::DownloadManager { | 21 class MockDownloadManager : public content::DownloadManager { |
| 21 public: | 22 public: |
| 22 MockDownloadManager(); | 23 MockDownloadManager(); |
| 23 virtual ~MockDownloadManager(); | 24 virtual ~MockDownloadManager(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 45 int64 size, | 46 int64 size, |
| 46 const std::string& hash_state, | 47 const std::string& hash_state, |
| 47 content::DownloadInterruptReason reason)); | 48 content::DownloadInterruptReason reason)); |
| 48 MOCK_METHOD3(OnDownloadRenamedToFinalName, void(int download_id, | 49 MOCK_METHOD3(OnDownloadRenamedToFinalName, void(int download_id, |
| 49 const FilePath& full_path, | 50 const FilePath& full_path, |
| 50 int uniquifier)); | 51 int uniquifier)); |
| 51 MOCK_METHOD2(RemoveDownloadsBetween, int(base::Time remove_begin, | 52 MOCK_METHOD2(RemoveDownloadsBetween, int(base::Time remove_begin, |
| 52 base::Time remove_end)); | 53 base::Time remove_end)); |
| 53 MOCK_METHOD1(RemoveDownloads, int(base::Time remove_begin)); | 54 MOCK_METHOD1(RemoveDownloads, int(base::Time remove_begin)); |
| 54 MOCK_METHOD0(RemoveAllDownloads, int()); | 55 MOCK_METHOD0(RemoveAllDownloads, int()); |
| 55 MOCK_METHOD8(DownloadUrl, | 56 MOCK_METHOD1(DownloadUrlMock, void(DownloadUrlParameters*)); |
| 56 void(const GURL& url, | 57 virtual void DownloadUrl(scoped_ptr<DownloadUrlParameters> params) OVERRIDE { |
| 57 const GURL& referrer, | 58 DownloadUrlMock(params.get()); |
| 58 const std::string& referrer_encoding, | 59 } |
| 59 bool prefer_cache, | |
| 60 int64 post_id, | |
| 61 const DownloadSaveInfo& save_info, | |
| 62 content::WebContents* web_contents, | |
| 63 const DownloadManager::OnStartedCallback& callback)); | |
| 64 MOCK_METHOD1(AddObserver, void(Observer* observer)); | 60 MOCK_METHOD1(AddObserver, void(Observer* observer)); |
| 65 MOCK_METHOD1(RemoveObserver, void(Observer* observer)); | 61 MOCK_METHOD1(RemoveObserver, void(Observer* observer)); |
| 66 MOCK_METHOD1(OnPersistentStoreQueryComplete, void( | 62 MOCK_METHOD1(OnPersistentStoreQueryComplete, void( |
| 67 std::vector<DownloadPersistentStoreInfo>* entries)); | 63 std::vector<DownloadPersistentStoreInfo>* entries)); |
| 68 MOCK_METHOD2(OnItemAddedToPersistentStore, void(int32 download_id, | 64 MOCK_METHOD2(OnItemAddedToPersistentStore, void(int32 download_id, |
| 69 int64 db_handle)); | 65 int64 db_handle)); |
| 70 MOCK_CONST_METHOD0(InProgressCount, int()); | 66 MOCK_CONST_METHOD0(InProgressCount, int()); |
| 71 MOCK_CONST_METHOD0(GetBrowserContext, content::BrowserContext*()); | 67 MOCK_CONST_METHOD0(GetBrowserContext, content::BrowserContext*()); |
| 72 MOCK_METHOD0(LastDownloadPath, FilePath()); | 68 MOCK_METHOD0(LastDownloadPath, FilePath()); |
| 73 MOCK_METHOD2(CreateDownloadItem, net::BoundNetLog( | 69 MOCK_METHOD2(CreateDownloadItem, net::BoundNetLog( |
| (...skipping 18 matching lines...) Expand all Loading... |
| 92 content::DownloadManagerDelegate* delegate)); | 88 content::DownloadManagerDelegate* delegate)); |
| 93 MOCK_METHOD2(ContinueDownloadWithPath, void(content::DownloadItem* download, | 89 MOCK_METHOD2(ContinueDownloadWithPath, void(content::DownloadItem* download, |
| 94 const FilePath& chosen_file)); | 90 const FilePath& chosen_file)); |
| 95 MOCK_METHOD1(GetActiveDownload, content::DownloadItem*(int32 download_id)); | 91 MOCK_METHOD1(GetActiveDownload, content::DownloadItem*(int32 download_id)); |
| 96 MOCK_METHOD1(SetFileManager, void(DownloadFileManager* file_manager)); | 92 MOCK_METHOD1(SetFileManager, void(DownloadFileManager* file_manager)); |
| 97 }; | 93 }; |
| 98 | 94 |
| 99 } // namespace content | 95 } // namespace content |
| 100 | 96 |
| 101 #endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ | 97 #endif // CONTENT_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |