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 // An implementation of BrowserProcess for unit tests that fails for most | 5 // An implementation of BrowserProcess for unit tests that fails for most |
6 // services. By preventing creation of services, we reduce dependencies and | 6 // services. By preventing creation of services, we reduce dependencies and |
7 // keep the profile clean. Clients of this class must handle the NULL return | 7 // keep the profile clean. Clients of this class must handle the NULL return |
8 // value, however. | 8 // value, however. |
9 | 9 |
10 #ifndef CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ | 10 #ifndef CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 scoped_ptr<printing::PrintJobManager> print_job_manager_; | 159 scoped_ptr<printing::PrintJobManager> print_job_manager_; |
160 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; | 160 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; |
161 scoped_refptr<printing::PrintPreviewDialogController> | 161 scoped_refptr<printing::PrintPreviewDialogController> |
162 print_preview_dialog_controller_; | 162 print_preview_dialog_controller_; |
163 #endif | 163 #endif |
164 | 164 |
165 scoped_ptr<prerender::PrerenderTracker> prerender_tracker_; | 165 scoped_ptr<prerender::PrerenderTracker> prerender_tracker_; |
166 scoped_refptr<SafeBrowsingService> sb_service_; | 166 scoped_refptr<SafeBrowsingService> sb_service_; |
167 #endif // !defined(OS_IOS) | 167 #endif // !defined(OS_IOS) |
168 | 168 |
169 #if !defined(OS_IOS) && !defined(OS_ANDROID) | |
170 scoped_ptr<MediaFileSystemRegistry> media_file_system_registry_; | |
171 #endif | |
172 | |
173 scoped_ptr<network_time::NetworkTimeTracker> network_time_tracker_; | 169 scoped_ptr<network_time::NetworkTimeTracker> network_time_tracker_; |
174 | 170 |
175 // The following objects are not owned by TestingBrowserProcess: | 171 // The following objects are not owned by TestingBrowserProcess: |
176 PrefService* local_state_; | 172 PrefService* local_state_; |
177 IOThread* io_thread_; | 173 IOThread* io_thread_; |
178 net::URLRequestContextGetter* system_request_context_; | 174 net::URLRequestContextGetter* system_request_context_; |
179 | 175 |
180 scoped_ptr<BrowserProcessPlatformPart> platform_part_; | 176 scoped_ptr<BrowserProcessPlatformPart> platform_part_; |
181 | 177 |
| 178 #if defined(ENABLE_EXTENSIONS) |
| 179 scoped_ptr<MediaFileSystemRegistry> media_file_system_registry_; |
| 180 |
182 scoped_ptr<extensions::ExtensionsBrowserClient> extensions_browser_client_; | 181 scoped_ptr<extensions::ExtensionsBrowserClient> extensions_browser_client_; |
| 182 #endif |
183 | 183 |
184 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); | 184 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); |
185 }; | 185 }; |
186 | 186 |
187 // RAII (resource acquisition is initialization) for TestingBrowserProcess. | 187 // RAII (resource acquisition is initialization) for TestingBrowserProcess. |
188 // Allows you to initialize TestingBrowserProcess/NotificationService before | 188 // Allows you to initialize TestingBrowserProcess/NotificationService before |
189 // other member variables. | 189 // other member variables. |
190 // | 190 // |
191 // This can be helpful if you are running a unit test inside the browser_tests | 191 // This can be helpful if you are running a unit test inside the browser_tests |
192 // suite because browser_tests do not make a TestingBrowserProcess for you. | 192 // suite because browser_tests do not make a TestingBrowserProcess for you. |
193 // | 193 // |
194 // class MyUnitTestRunningAsBrowserTest : public testing::Test { | 194 // class MyUnitTestRunningAsBrowserTest : public testing::Test { |
195 // ...stuff... | 195 // ...stuff... |
196 // private: | 196 // private: |
197 // TestingBrowserProcessInitializer initializer_; | 197 // TestingBrowserProcessInitializer initializer_; |
198 // LocalState local_state_; // Needs a BrowserProcess to initialize. | 198 // LocalState local_state_; // Needs a BrowserProcess to initialize. |
199 // NotificationRegistrar registar_; // Needs NotificationService. | 199 // NotificationRegistrar registar_; // Needs NotificationService. |
200 // }; | 200 // }; |
201 class TestingBrowserProcessInitializer { | 201 class TestingBrowserProcessInitializer { |
202 public: | 202 public: |
203 TestingBrowserProcessInitializer(); | 203 TestingBrowserProcessInitializer(); |
204 ~TestingBrowserProcessInitializer(); | 204 ~TestingBrowserProcessInitializer(); |
205 | 205 |
206 private: | 206 private: |
207 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcessInitializer); | 207 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcessInitializer); |
208 }; | 208 }; |
209 | 209 |
210 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ | 210 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ |
OLD | NEW |