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_METHOD1(GetAllDownloads, void(DownloadVector* downloads)); | 28 MOCK_METHOD1(GetAllDownloads, void(DownloadVector* downloads)); |
29 MOCK_METHOD2(SearchDownloads, void(const string16& query, | |
30 DownloadVector* result)); | |
31 MOCK_METHOD1(Init, bool(BrowserContext* browser_context)); | 29 MOCK_METHOD1(Init, bool(BrowserContext* browser_context)); |
32 | 30 |
33 // Gasket for handling scoped_ptr arguments. | 31 // Gasket for handling scoped_ptr arguments. |
34 virtual DownloadId StartDownload( | 32 virtual DownloadId StartDownload( |
35 scoped_ptr<DownloadCreateInfo> info, | 33 scoped_ptr<DownloadCreateInfo> info, |
36 scoped_ptr<ByteStreamReader> stream) OVERRIDE; | 34 scoped_ptr<ByteStreamReader> stream) OVERRIDE; |
37 | 35 |
38 MOCK_METHOD2(MockStartDownload, | 36 MOCK_METHOD2(MockStartDownload, |
39 DownloadId(DownloadCreateInfo*, | 37 DownloadId(DownloadCreateInfo*, |
40 ByteStreamReader*)); | 38 ByteStreamReader*)); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 MOCK_METHOD1(GetActiveDownloadItem, DownloadItem*(int id)); | 70 MOCK_METHOD1(GetActiveDownloadItem, DownloadItem*(int id)); |
73 MOCK_METHOD1(GetActiveDownload, DownloadItem*(int32 download_id)); | 71 MOCK_METHOD1(GetActiveDownload, DownloadItem*(int32 download_id)); |
74 | 72 |
75 protected: | 73 protected: |
76 virtual ~MockDownloadManager(); | 74 virtual ~MockDownloadManager(); |
77 }; | 75 }; |
78 | 76 |
79 } // namespace content | 77 } // namespace content |
80 | 78 |
81 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ | 79 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ |
OLD | NEW |