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_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ |
7 | 7 |
8 #include "content/public/browser/download_manager.h" | 8 #include "content/public/browser/download_manager.h" |
9 #include "content/public/browser/download_save_info.h" | 9 #include "content/public/browser/download_save_info.h" |
10 #include "content/public/browser/download_url_parameters.h" | 10 #include "content/public/browser/download_url_parameters.h" |
11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 // To avoid leaking download_request_handle.h to embedders. | 15 // To avoid leaking download_request_handle.h to embedders. |
16 void PrintTo(const DownloadRequestHandle& params, std::ostream* os); | 16 void PrintTo(const DownloadRequestHandle& params, std::ostream* os); |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class MockDownloadManager : public DownloadManager { | 20 class MockDownloadManager : public DownloadManager { |
21 public: | 21 public: |
22 MockDownloadManager(); | 22 MockDownloadManager(); |
23 | 23 |
24 // DownloadManager: | 24 // DownloadManager: |
25 MOCK_METHOD1(SetDelegate, void(DownloadManagerDelegate* delegate)); | 25 MOCK_METHOD1(SetDelegate, void(DownloadManagerDelegate* delegate)); |
26 MOCK_CONST_METHOD0(GetDelegate, DownloadManagerDelegate*()); | 26 MOCK_CONST_METHOD0(GetDelegate, DownloadManagerDelegate*()); |
27 MOCK_METHOD0(Shutdown, void()); | 27 MOCK_METHOD0(Shutdown, void()); |
28 MOCK_METHOD2(GetTemporaryDownloads, void(const FilePath& dir_path, | 28 MOCK_METHOD2(GetTemporaryDownloads, void(const FilePath& dir_path, |
29 DownloadVector* result)); | 29 DownloadVector* result)); |
30 MOCK_METHOD2(GetAllDownloads, void(const FilePath& dir_path, | 30 MOCK_METHOD1(GetAllDownloads, void(DownloadVector* downloads)); |
31 DownloadVector* result)); | |
32 MOCK_METHOD2(SearchDownloads, void(const string16& query, | 31 MOCK_METHOD2(SearchDownloads, void(const string16& query, |
33 DownloadVector* result)); | 32 DownloadVector* result)); |
34 MOCK_METHOD1(Init, bool(BrowserContext* browser_context)); | 33 MOCK_METHOD1(Init, bool(BrowserContext* browser_context)); |
35 | 34 |
36 // Gasket for handling scoped_ptr arguments. | 35 // Gasket for handling scoped_ptr arguments. |
37 virtual DownloadId StartDownload( | 36 virtual DownloadId StartDownload( |
38 scoped_ptr<DownloadCreateInfo> info, | 37 scoped_ptr<DownloadCreateInfo> info, |
39 scoped_ptr<ByteStreamReader> stream) OVERRIDE; | 38 scoped_ptr<ByteStreamReader> stream) OVERRIDE; |
40 | 39 |
41 MOCK_METHOD2(MockStartDownload, | 40 MOCK_METHOD2(MockStartDownload, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 MOCK_METHOD0(GenerateFileHash, bool()); | 75 MOCK_METHOD0(GenerateFileHash, bool()); |
77 MOCK_METHOD1(GetActiveDownload, DownloadItem*(int32 download_id)); | 76 MOCK_METHOD1(GetActiveDownload, DownloadItem*(int32 download_id)); |
78 | 77 |
79 protected: | 78 protected: |
80 virtual ~MockDownloadManager(); | 79 virtual ~MockDownloadManager(); |
81 }; | 80 }; |
82 | 81 |
83 } // namespace content | 82 } // namespace content |
84 | 83 |
85 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ | 84 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ |
OLD | NEW |