Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: content/public/test/mock_download_manager.h

Issue 10913015: Reland DownloadManager::GetAllDownloads actually does now (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/public/test/download_test_observer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_METHOD1(GetAllDownloads, void(DownloadVector* downloads));
29 DownloadVector* result));
30 MOCK_METHOD2(GetAllDownloads, void(const FilePath& dir_path,
31 DownloadVector* result));
32 MOCK_METHOD2(SearchDownloads, void(const string16& query, 29 MOCK_METHOD2(SearchDownloads, void(const string16& query,
33 DownloadVector* result)); 30 DownloadVector* result));
34 MOCK_METHOD1(Init, bool(BrowserContext* browser_context)); 31 MOCK_METHOD1(Init, bool(BrowserContext* browser_context));
35 32
36 // Gasket for handling scoped_ptr arguments. 33 // Gasket for handling scoped_ptr arguments.
37 virtual DownloadId StartDownload( 34 virtual DownloadId StartDownload(
38 scoped_ptr<DownloadCreateInfo> info, 35 scoped_ptr<DownloadCreateInfo> info,
39 scoped_ptr<ByteStreamReader> stream) OVERRIDE; 36 scoped_ptr<ByteStreamReader> stream) OVERRIDE;
40 37
41 MOCK_METHOD2(MockStartDownload, 38 MOCK_METHOD2(MockStartDownload,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 MOCK_METHOD0(GenerateFileHash, bool()); 73 MOCK_METHOD0(GenerateFileHash, bool());
77 MOCK_METHOD1(GetActiveDownload, DownloadItem*(int32 download_id)); 74 MOCK_METHOD1(GetActiveDownload, DownloadItem*(int32 download_id));
78 75
79 protected: 76 protected:
80 virtual ~MockDownloadManager(); 77 virtual ~MockDownloadManager();
81 }; 78 };
82 79
83 } // namespace content 80 } // namespace content
84 81
85 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ 82 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_
OLDNEW
« no previous file with comments | « content/public/test/download_test_observer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698