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 #include "chrome/test/base/testing_browser_process.h" | 5 #include "chrome/test/base/testing_browser_process.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/background/background_mode_manager.h" | 10 #include "chrome/browser/background/background_mode_manager.h" |
11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/browser_process_impl.h" | 12 #include "chrome/browser/browser_process_impl.h" |
13 #include "chrome/browser/extensions/chrome_extensions_browser_client.h" | 13 #include "chrome/browser/extensions/chrome_extensions_browser_client.h" |
14 #include "chrome/browser/printing/print_job_manager.h" | 14 #include "chrome/browser/printing/print_job_manager.h" |
15 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
16 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" | 16 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h" |
17 #include "chrome/test/base/testing_browser_process_platform_part.h" | 17 #include "chrome/test/base/testing_browser_process_platform_part.h" |
18 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
19 #include "net/url_request/url_request_context_getter.h" | 19 #include "net/url_request/url_request_context_getter.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 #include "ui/message_center/message_center.h" | 21 #include "ui/message_center/message_center.h" |
22 | 22 |
23 #if !defined(OS_IOS) | 23 #if !defined(OS_IOS) |
24 #include "chrome/browser/notifications/notification_ui_manager.h" | 24 #include "chrome/browser/notifications/notification_ui_manager.h" |
25 #include "chrome/browser/prerender/prerender_tracker.h" | 25 #include "chrome/browser/prerender/prerender_tracker.h" |
26 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 26 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
27 #include "chrome/browser/thumbnails/render_widget_snapshot_taker.h" | |
28 #endif | 27 #endif |
29 | 28 |
30 #if !defined(OS_IOS) && !defined(OS_ANDROID) | 29 #if !defined(OS_IOS) && !defined(OS_ANDROID) |
31 #include "chrome/browser/media_galleries/media_file_system_registry.h" | 30 #include "chrome/browser/media_galleries/media_file_system_registry.h" |
32 #include "chrome/browser/storage_monitor/storage_monitor.h" | 31 #include "chrome/browser/storage_monitor/storage_monitor.h" |
33 #include "chrome/browser/storage_monitor/test_storage_monitor.h" | 32 #include "chrome/browser/storage_monitor/test_storage_monitor.h" |
34 #endif | 33 #endif |
35 | 34 |
36 #if defined(ENABLE_CONFIGURATION_POLICY) | 35 #if defined(ENABLE_CONFIGURATION_POLICY) |
37 #include "components/policy/core/browser/browser_policy_connector.h" | 36 #include "components/policy/core/browser/browser_policy_connector.h" |
(...skipping 22 matching lines...) Expand all Loading... |
60 // g_browser_process must be NULL during its own destruction. | 59 // g_browser_process must be NULL during its own destruction. |
61 BrowserProcess* browser_process = g_browser_process; | 60 BrowserProcess* browser_process = g_browser_process; |
62 g_browser_process = NULL; | 61 g_browser_process = NULL; |
63 delete browser_process; | 62 delete browser_process; |
64 } | 63 } |
65 | 64 |
66 TestingBrowserProcess::TestingBrowserProcess() | 65 TestingBrowserProcess::TestingBrowserProcess() |
67 : notification_service_(content::NotificationService::Create()), | 66 : notification_service_(content::NotificationService::Create()), |
68 module_ref_count_(0), | 67 module_ref_count_(0), |
69 app_locale_("en"), | 68 app_locale_("en"), |
70 #if !defined(OS_IOS) | |
71 render_widget_snapshot_taker_(new RenderWidgetSnapshotTaker), | |
72 #endif | |
73 local_state_(NULL), | 69 local_state_(NULL), |
74 io_thread_(NULL), | 70 io_thread_(NULL), |
75 system_request_context_(NULL), | 71 system_request_context_(NULL), |
76 platform_part_(new TestingBrowserProcessPlatformPart()), | 72 platform_part_(new TestingBrowserProcessPlatformPart()), |
77 extensions_browser_client_( | 73 extensions_browser_client_( |
78 new extensions::ChromeExtensionsBrowserClient) { | 74 new extensions::ChromeExtensionsBrowserClient) { |
79 extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get()); | 75 extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get()); |
80 } | 76 } |
81 | 77 |
82 TestingBrowserProcess::~TestingBrowserProcess() { | 78 TestingBrowserProcess::~TestingBrowserProcess() { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 165 } |
170 | 166 |
171 GLStringManager* TestingBrowserProcess::gl_string_manager() { | 167 GLStringManager* TestingBrowserProcess::gl_string_manager() { |
172 return NULL; | 168 return NULL; |
173 } | 169 } |
174 | 170 |
175 GpuModeManager* TestingBrowserProcess::gpu_mode_manager() { | 171 GpuModeManager* TestingBrowserProcess::gpu_mode_manager() { |
176 return NULL; | 172 return NULL; |
177 } | 173 } |
178 | 174 |
179 RenderWidgetSnapshotTaker* | |
180 TestingBrowserProcess::GetRenderWidgetSnapshotTaker() { | |
181 #if defined(OS_IOS) | |
182 NOTREACHED(); | |
183 return NULL; | |
184 #else | |
185 return render_widget_snapshot_taker_.get(); | |
186 #endif | |
187 } | |
188 | |
189 BackgroundModeManager* TestingBrowserProcess::background_mode_manager() { | 175 BackgroundModeManager* TestingBrowserProcess::background_mode_manager() { |
190 return NULL; | 176 return NULL; |
191 } | 177 } |
192 | 178 |
193 void TestingBrowserProcess::set_background_mode_manager_for_test( | 179 void TestingBrowserProcess::set_background_mode_manager_for_test( |
194 scoped_ptr<BackgroundModeManager> manager) { | 180 scoped_ptr<BackgroundModeManager> manager) { |
195 NOTREACHED(); | 181 NOTREACHED(); |
196 } | 182 } |
197 | 183 |
198 StatusTray* TestingBrowserProcess::status_tray() { | 184 StatusTray* TestingBrowserProcess::status_tray() { |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 445 |
460 /////////////////////////////////////////////////////////////////////////////// | 446 /////////////////////////////////////////////////////////////////////////////// |
461 | 447 |
462 TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { | 448 TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { |
463 TestingBrowserProcess::CreateInstance(); | 449 TestingBrowserProcess::CreateInstance(); |
464 } | 450 } |
465 | 451 |
466 TestingBrowserProcessInitializer::~TestingBrowserProcessInitializer() { | 452 TestingBrowserProcessInitializer::~TestingBrowserProcessInitializer() { |
467 TestingBrowserProcess::DeleteInstance(); | 453 TestingBrowserProcess::DeleteInstance(); |
468 } | 454 } |
OLD | NEW |