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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 // Set the local state for tests. Consumer is responsible for cleaning it up | 132 // Set the local state for tests. Consumer is responsible for cleaning it up |
133 // afterwards (using ScopedTestingLocalState, for example). | 133 // afterwards (using ScopedTestingLocalState, for example). |
134 void SetLocalState(PrefService* local_state); | 134 void SetLocalState(PrefService* local_state); |
135 void SetProfileManager(ProfileManager* profile_manager); | 135 void SetProfileManager(ProfileManager* profile_manager); |
136 void SetIOThread(IOThread* io_thread); | 136 void SetIOThread(IOThread* io_thread); |
137 void SetSafeBrowsingService(safe_browsing::SafeBrowsingService* sb_service); | 137 void SetSafeBrowsingService(safe_browsing::SafeBrowsingService* sb_service); |
138 void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); | 138 void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); |
139 void SetNotificationUIManager( | 139 void SetNotificationUIManager( |
140 std::unique_ptr<NotificationUIManager> notification_ui_manager); | 140 std::unique_ptr<NotificationUIManager> notification_ui_manager); |
| 141 void SetNotificationPlatformBridge( |
| 142 std::unique_ptr<NotificationPlatformBridge> notification_platform_bridge); |
141 void SetRapporService(rappor::RapporService* rappor_service); | 143 void SetRapporService(rappor::RapporService* rappor_service); |
142 void ShutdownBrowserPolicyConnector(); | 144 void ShutdownBrowserPolicyConnector(); |
143 | 145 |
144 private: | 146 private: |
145 // See CreateInstance() and DestoryInstance() above. | 147 // See CreateInstance() and DestoryInstance() above. |
146 TestingBrowserProcess(); | 148 TestingBrowserProcess(); |
147 ~TestingBrowserProcess() override; | 149 ~TestingBrowserProcess() override; |
148 | 150 |
149 std::unique_ptr<content::NotificationService> notification_service_; | 151 std::unique_ptr<content::NotificationService> notification_service_; |
150 std::string app_locale_; | 152 std::string app_locale_; |
151 | 153 |
152 std::unique_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; | 154 std::unique_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; |
153 bool created_browser_policy_connector_ = false; | 155 bool created_browser_policy_connector_ = false; |
154 std::unique_ptr<ProfileManager> profile_manager_; | 156 std::unique_ptr<ProfileManager> profile_manager_; |
155 std::unique_ptr<NotificationUIManager> notification_ui_manager_; | 157 std::unique_ptr<NotificationUIManager> notification_ui_manager_; |
| 158 std::unique_ptr<NotificationPlatformBridge> notification_platform_bridge_; |
156 | 159 |
157 #if defined(ENABLE_PRINTING) | 160 #if defined(ENABLE_PRINTING) |
158 std::unique_ptr<printing::PrintJobManager> print_job_manager_; | 161 std::unique_ptr<printing::PrintJobManager> print_job_manager_; |
159 #endif | 162 #endif |
160 | 163 |
161 #if defined(ENABLE_PRINT_PREVIEW) | 164 #if defined(ENABLE_PRINT_PREVIEW) |
162 std::unique_ptr<printing::BackgroundPrintingManager> | 165 std::unique_ptr<printing::BackgroundPrintingManager> |
163 background_printing_manager_; | 166 background_printing_manager_; |
164 scoped_refptr<printing::PrintPreviewDialogController> | 167 scoped_refptr<printing::PrintPreviewDialogController> |
165 print_preview_dialog_controller_; | 168 print_preview_dialog_controller_; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 class TestingBrowserProcessInitializer { | 207 class TestingBrowserProcessInitializer { |
205 public: | 208 public: |
206 TestingBrowserProcessInitializer(); | 209 TestingBrowserProcessInitializer(); |
207 ~TestingBrowserProcessInitializer(); | 210 ~TestingBrowserProcessInitializer(); |
208 | 211 |
209 private: | 212 private: |
210 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcessInitializer); | 213 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcessInitializer); |
211 }; | 214 }; |
212 | 215 |
213 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ | 216 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ |
OLD | NEW |