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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 net::URLRequestContextGetter* system_request_context() override; | 85 net::URLRequestContextGetter* system_request_context() override; |
86 BrowserProcessPlatformPart* platform_part() override; | 86 BrowserProcessPlatformPart* platform_part() override; |
87 | 87 |
88 extensions::EventRouterForwarder* extension_event_router_forwarder() override; | 88 extensions::EventRouterForwarder* extension_event_router_forwarder() override; |
89 NotificationUIManager* notification_ui_manager() override; | 89 NotificationUIManager* notification_ui_manager() override; |
90 message_center::MessageCenter* message_center() override; | 90 message_center::MessageCenter* message_center() override; |
91 IntranetRedirectDetector* intranet_redirect_detector() override; | 91 IntranetRedirectDetector* intranet_redirect_detector() override; |
92 void CreateDevToolsHttpProtocolHandler(const std::string& ip, | 92 void CreateDevToolsHttpProtocolHandler(const std::string& ip, |
93 uint16_t port) override; | 93 uint16_t port) override; |
94 void CreateDevToolsAutoOpener() override; | 94 void CreateDevToolsAutoOpener() override; |
95 unsigned int AddRefModule() override; | |
96 unsigned int ReleaseModule() override; | |
97 bool IsShuttingDown() override; | 95 bool IsShuttingDown() override; |
98 printing::PrintJobManager* print_job_manager() override; | 96 printing::PrintJobManager* print_job_manager() override; |
99 printing::PrintPreviewDialogController* print_preview_dialog_controller() | 97 printing::PrintPreviewDialogController* print_preview_dialog_controller() |
100 override; | 98 override; |
101 printing::BackgroundPrintingManager* background_printing_manager() override; | 99 printing::BackgroundPrintingManager* background_printing_manager() override; |
102 const std::string& GetApplicationLocale() override; | 100 const std::string& GetApplicationLocale() override; |
103 void SetApplicationLocale(const std::string& app_locale) override; | 101 void SetApplicationLocale(const std::string& app_locale) override; |
104 DownloadStatusUpdater* download_status_updater() override; | 102 DownloadStatusUpdater* download_status_updater() override; |
105 DownloadRequestLimiter* download_request_limiter() override; | 103 DownloadRequestLimiter* download_request_limiter() override; |
106 | 104 |
(...skipping 27 matching lines...) Expand all Loading... |
134 void SetLocalState(PrefService* local_state); | 132 void SetLocalState(PrefService* local_state); |
135 void SetProfileManager(ProfileManager* profile_manager); | 133 void SetProfileManager(ProfileManager* profile_manager); |
136 void SetIOThread(IOThread* io_thread); | 134 void SetIOThread(IOThread* io_thread); |
137 void SetSafeBrowsingService(safe_browsing::SafeBrowsingService* sb_service); | 135 void SetSafeBrowsingService(safe_browsing::SafeBrowsingService* sb_service); |
138 void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); | 136 void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); |
139 void SetNotificationUIManager( | 137 void SetNotificationUIManager( |
140 scoped_ptr<NotificationUIManager> notification_ui_manager); | 138 scoped_ptr<NotificationUIManager> notification_ui_manager); |
141 void SetRapporService(rappor::RapporService* rappor_service); | 139 void SetRapporService(rappor::RapporService* rappor_service); |
142 void ShutdownBrowserPolicyConnector(); | 140 void ShutdownBrowserPolicyConnector(); |
143 | 141 |
144 unsigned int module_ref_count() const { return module_ref_count_; } | |
145 | |
146 private: | 142 private: |
147 // See CreateInstance() and DestoryInstance() above. | 143 // See CreateInstance() and DestoryInstance() above. |
148 TestingBrowserProcess(); | 144 TestingBrowserProcess(); |
149 ~TestingBrowserProcess() override; | 145 ~TestingBrowserProcess() override; |
150 | 146 |
151 scoped_ptr<content::NotificationService> notification_service_; | 147 scoped_ptr<content::NotificationService> notification_service_; |
152 unsigned int module_ref_count_; | |
153 std::string app_locale_; | 148 std::string app_locale_; |
154 | 149 |
155 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; | 150 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; |
156 bool created_browser_policy_connector_ = false; | 151 bool created_browser_policy_connector_ = false; |
157 scoped_ptr<ProfileManager> profile_manager_; | 152 scoped_ptr<ProfileManager> profile_manager_; |
158 scoped_ptr<NotificationUIManager> notification_ui_manager_; | 153 scoped_ptr<NotificationUIManager> notification_ui_manager_; |
159 | 154 |
160 #if defined(ENABLE_PRINTING) | 155 #if defined(ENABLE_PRINTING) |
161 scoped_ptr<printing::PrintJobManager> print_job_manager_; | 156 scoped_ptr<printing::PrintJobManager> print_job_manager_; |
162 #endif | 157 #endif |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 class TestingBrowserProcessInitializer { | 200 class TestingBrowserProcessInitializer { |
206 public: | 201 public: |
207 TestingBrowserProcessInitializer(); | 202 TestingBrowserProcessInitializer(); |
208 ~TestingBrowserProcessInitializer(); | 203 ~TestingBrowserProcessInitializer(); |
209 | 204 |
210 private: | 205 private: |
211 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcessInitializer); | 206 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcessInitializer); |
212 }; | 207 }; |
213 | 208 |
214 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ | 209 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ |
OLD | NEW |