| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Convenience method to get g_browser_process as a TestingBrowserProcess*. | 60 // Convenience method to get g_browser_process as a TestingBrowserProcess*. |
| 61 static TestingBrowserProcess* GetGlobal(); | 61 static TestingBrowserProcess* GetGlobal(); |
| 62 | 62 |
| 63 // BrowserProcess overrides: | 63 // BrowserProcess overrides: |
| 64 void ResourceDispatcherHostCreated() override; | 64 void ResourceDispatcherHostCreated() override; |
| 65 void EndSession() override; | 65 void EndSession() override; |
| 66 metrics_services_manager::MetricsServicesManager* GetMetricsServicesManager() | 66 metrics_services_manager::MetricsServicesManager* GetMetricsServicesManager() |
| 67 override; | 67 override; |
| 68 metrics::MetricsService* metrics_service() override; | 68 metrics::MetricsService* metrics_service() override; |
| 69 rappor::RapporServiceImpl* rappor_service() override; | 69 rappor::RapporServiceImpl* rappor_service() override; |
| 70 ukm::UkmService* ukm_service() override; |
| 70 IOThread* io_thread() override; | 71 IOThread* io_thread() override; |
| 71 WatchDogThread* watchdog_thread() override; | 72 WatchDogThread* watchdog_thread() override; |
| 72 ProfileManager* profile_manager() override; | 73 ProfileManager* profile_manager() override; |
| 73 PrefService* local_state() override; | 74 PrefService* local_state() override; |
| 74 variations::VariationsService* variations_service() override; | 75 variations::VariationsService* variations_service() override; |
| 75 policy::BrowserPolicyConnector* browser_policy_connector() override; | 76 policy::BrowserPolicyConnector* browser_policy_connector() override; |
| 76 policy::PolicyService* policy_service() override; | 77 policy::PolicyService* policy_service() override; |
| 77 IconManager* icon_manager() override; | 78 IconManager* icon_manager() override; |
| 78 GpuProfileCache* gpu_profile_cache() override; | 79 GpuProfileCache* gpu_profile_cache() override; |
| 79 GpuModeManager* gpu_mode_manager() override; | 80 GpuModeManager* gpu_mode_manager() override; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 void SetIOThread(IOThread* io_thread); | 141 void SetIOThread(IOThread* io_thread); |
| 141 void SetSafeBrowsingService(safe_browsing::SafeBrowsingService* sb_service); | 142 void SetSafeBrowsingService(safe_browsing::SafeBrowsingService* sb_service); |
| 142 void SetRulesetService( | 143 void SetRulesetService( |
| 143 std::unique_ptr<subresource_filter::RulesetService> ruleset_service); | 144 std::unique_ptr<subresource_filter::RulesetService> ruleset_service); |
| 144 void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); | 145 void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); |
| 145 void SetNotificationUIManager( | 146 void SetNotificationUIManager( |
| 146 std::unique_ptr<NotificationUIManager> notification_ui_manager); | 147 std::unique_ptr<NotificationUIManager> notification_ui_manager); |
| 147 void SetNotificationPlatformBridge( | 148 void SetNotificationPlatformBridge( |
| 148 std::unique_ptr<NotificationPlatformBridge> notification_platform_bridge); | 149 std::unique_ptr<NotificationPlatformBridge> notification_platform_bridge); |
| 149 void SetRapporServiceImpl(rappor::RapporServiceImpl* rappor_service); | 150 void SetRapporServiceImpl(rappor::RapporServiceImpl* rappor_service); |
| 151 void SetUkmService(ukm::UkmService* ukm_service); |
| 150 void SetShuttingDown(bool is_shutting_down); | 152 void SetShuttingDown(bool is_shutting_down); |
| 151 void ShutdownBrowserPolicyConnector(); | 153 void ShutdownBrowserPolicyConnector(); |
| 152 | 154 |
| 153 private: | 155 private: |
| 154 // See CreateInstance() and DestoryInstance() above. | 156 // See CreateInstance() and DestoryInstance() above. |
| 155 TestingBrowserProcess(); | 157 TestingBrowserProcess(); |
| 156 ~TestingBrowserProcess() override; | 158 ~TestingBrowserProcess() override; |
| 157 | 159 |
| 158 std::unique_ptr<content::NotificationService> notification_service_; | 160 std::unique_ptr<content::NotificationService> notification_service_; |
| 159 std::string app_locale_; | 161 std::string app_locale_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 186 // GetTabManager() is invoked on supported platforms. | 188 // GetTabManager() is invoked on supported platforms. |
| 187 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) | 189 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
| 188 std::unique_ptr<memory::TabManager> tab_manager_; | 190 std::unique_ptr<memory::TabManager> tab_manager_; |
| 189 #endif | 191 #endif |
| 190 | 192 |
| 191 // The following objects are not owned by TestingBrowserProcess: | 193 // The following objects are not owned by TestingBrowserProcess: |
| 192 PrefService* local_state_; | 194 PrefService* local_state_; |
| 193 IOThread* io_thread_; | 195 IOThread* io_thread_; |
| 194 net::URLRequestContextGetter* system_request_context_; | 196 net::URLRequestContextGetter* system_request_context_; |
| 195 rappor::RapporServiceImpl* rappor_service_; | 197 rappor::RapporServiceImpl* rappor_service_; |
| 198 ukm::UkmService* ukm_service_; |
| 196 | 199 |
| 197 std::unique_ptr<BrowserProcessPlatformPart> platform_part_; | 200 std::unique_ptr<BrowserProcessPlatformPart> platform_part_; |
| 198 | 201 |
| 199 #if BUILDFLAG(ENABLE_EXTENSIONS) | 202 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 200 std::unique_ptr<MediaFileSystemRegistry> media_file_system_registry_; | 203 std::unique_ptr<MediaFileSystemRegistry> media_file_system_registry_; |
| 201 | 204 |
| 202 std::unique_ptr<extensions::ExtensionsBrowserClient> | 205 std::unique_ptr<extensions::ExtensionsBrowserClient> |
| 203 extensions_browser_client_; | 206 extensions_browser_client_; |
| 204 #endif | 207 #endif |
| 205 | 208 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 223 class TestingBrowserProcessInitializer { | 226 class TestingBrowserProcessInitializer { |
| 224 public: | 227 public: |
| 225 TestingBrowserProcessInitializer(); | 228 TestingBrowserProcessInitializer(); |
| 226 ~TestingBrowserProcessInitializer(); | 229 ~TestingBrowserProcessInitializer(); |
| 227 | 230 |
| 228 private: | 231 private: |
| 229 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcessInitializer); | 232 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcessInitializer); |
| 230 }; | 233 }; |
| 231 | 234 |
| 232 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ | 235 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ |
| OLD | NEW |