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

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

Issue 10535026: Move creation and ownership of DownloadManager from the embedder to content. This matches all the o… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros compile Created 8 years, 6 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
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 #pragma once 7 #pragma once
8 8
9 #include "content/public/browser/download_manager.h" 9 #include "content/public/browser/download_manager.h"
10 #include "content/public/browser/download_save_info.h" 10 #include "content/public/browser/download_save_info.h"
11 #include "content/public/browser/download_url_parameters.h" 11 #include "content/public/browser/download_url_parameters.h"
12 #include "googleurl/src/gurl.h" 12 #include "googleurl/src/gurl.h"
13 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 // To avoid leaking download_request_handle.h to embedders. 16 // To avoid leaking download_request_handle.h to embedders.
17 void PrintTo(const DownloadRequestHandle& params, std::ostream* os); 17 void PrintTo(const DownloadRequestHandle& params, std::ostream* os);
18 18
19 namespace content { 19 namespace content {
20 20
21 class MockDownloadManager : public content::DownloadManager { 21 class MockDownloadManager : public content::DownloadManager {
22 public: 22 public:
23 MockDownloadManager(); 23 MockDownloadManager();
24 24
25 // DownloadManager: 25 // DownloadManager:
26 MOCK_METHOD1(SetDelegate, void(DownloadManagerDelegate* delegate));
26 MOCK_METHOD0(Shutdown, void()); 27 MOCK_METHOD0(Shutdown, void());
27 MOCK_METHOD2(GetTemporaryDownloads, void(const FilePath& dir_path, 28 MOCK_METHOD2(GetTemporaryDownloads, void(const FilePath& dir_path,
28 DownloadVector* result)); 29 DownloadVector* result));
29 MOCK_METHOD2(GetAllDownloads, void(const FilePath& dir_path, 30 MOCK_METHOD2(GetAllDownloads, void(const FilePath& dir_path,
30 DownloadVector* result)); 31 DownloadVector* result));
31 MOCK_METHOD2(SearchDownloads, void(const string16& query, 32 MOCK_METHOD2(SearchDownloads, void(const string16& query,
32 DownloadVector* result)); 33 DownloadVector* result));
33 MOCK_METHOD1(Init, bool(content::BrowserContext* browser_context)); 34 MOCK_METHOD1(Init, bool(content::BrowserContext* browser_context));
34 MOCK_METHOD1(StartDownload, void(int32 id)); 35 MOCK_METHOD1(StartDownload, void(int32 id));
35 MOCK_METHOD4(UpdateDownload, void(int32 download_id, 36 MOCK_METHOD4(UpdateDownload, void(int32 download_id,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 MOCK_METHOD1(GetActiveDownload, content::DownloadItem*(int32 download_id)); 89 MOCK_METHOD1(GetActiveDownload, content::DownloadItem*(int32 download_id));
89 MOCK_METHOD1(SetFileManager, void(DownloadFileManager* file_manager)); 90 MOCK_METHOD1(SetFileManager, void(DownloadFileManager* file_manager));
90 91
91 protected: 92 protected:
92 virtual ~MockDownloadManager(); 93 virtual ~MockDownloadManager();
93 }; 94 };
94 95
95 } // namespace content 96 } // namespace content
96 97
97 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_ 98 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MOCK_DOWNLOAD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698