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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 98 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
99 virtual void StartAutoupdateTimer() OVERRIDE {} | 99 virtual void StartAutoupdateTimer() OVERRIDE {} |
100 #endif | 100 #endif |
101 | 101 |
102 virtual ChromeNetLog* net_log() OVERRIDE; | 102 virtual ChromeNetLog* net_log() OVERRIDE; |
103 virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE; | 103 virtual prerender::PrerenderTracker* prerender_tracker() OVERRIDE; |
104 virtual ComponentUpdateService* component_updater() OVERRIDE; | 104 virtual ComponentUpdateService* component_updater() OVERRIDE; |
105 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; | 105 virtual CRLSetFetcher* crl_set_fetcher() OVERRIDE; |
106 virtual PnaclComponentInstaller* pnacl_component_installer() OVERRIDE; | 106 virtual PnaclComponentInstaller* pnacl_component_installer() OVERRIDE; |
107 virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE; | 107 virtual BookmarkPromptController* bookmark_prompt_controller() OVERRIDE; |
108 virtual chrome::StorageMonitor* storage_monitor() OVERRIDE; | 108 virtual StorageMonitor* storage_monitor() OVERRIDE; |
109 virtual chrome::MediaFileSystemRegistry* | 109 virtual MediaFileSystemRegistry* media_file_system_registry() OVERRIDE; |
110 media_file_system_registry() OVERRIDE; | |
111 virtual bool created_local_state() const OVERRIDE; | 110 virtual bool created_local_state() const OVERRIDE; |
112 | 111 |
113 #if defined(ENABLE_WEBRTC) | 112 #if defined(ENABLE_WEBRTC) |
114 virtual WebRtcLogUploader* webrtc_log_uploader() OVERRIDE; | 113 virtual WebRtcLogUploader* webrtc_log_uploader() OVERRIDE; |
115 #endif | 114 #endif |
116 | 115 |
117 // Set the local state for tests. Consumer is responsible for cleaning it up | 116 // Set the local state for tests. Consumer is responsible for cleaning it up |
118 // afterwards (using ScopedTestingLocalState, for example). | 117 // afterwards (using ScopedTestingLocalState, for example). |
119 void SetLocalState(PrefService* local_state); | 118 void SetLocalState(PrefService* local_state); |
120 void SetProfileManager(ProfileManager* profile_manager); | 119 void SetProfileManager(ProfileManager* profile_manager); |
121 void SetIOThread(IOThread* io_thread); | 120 void SetIOThread(IOThread* io_thread); |
122 void SetBrowserPolicyConnector(policy::BrowserPolicyConnector* connector); | 121 void SetBrowserPolicyConnector(policy::BrowserPolicyConnector* connector); |
123 void SetSafeBrowsingService(SafeBrowsingService* sb_service); | 122 void SetSafeBrowsingService(SafeBrowsingService* sb_service); |
124 void SetBookmarkPromptController(BookmarkPromptController* controller); | 123 void SetBookmarkPromptController(BookmarkPromptController* controller); |
125 void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); | 124 void SetSystemRequestContext(net::URLRequestContextGetter* context_getter); |
126 void SetStorageMonitor(scoped_ptr<chrome::StorageMonitor> storage_monitor); | 125 void SetStorageMonitor(scoped_ptr<StorageMonitor> storage_monitor); |
127 | 126 |
128 private: | 127 private: |
129 scoped_ptr<content::NotificationService> notification_service_; | 128 scoped_ptr<content::NotificationService> notification_service_; |
130 unsigned int module_ref_count_; | 129 unsigned int module_ref_count_; |
131 std::string app_locale_; | 130 std::string app_locale_; |
132 | 131 |
133 // TODO(ios): Add back members as more code is compiled. | 132 // TODO(ios): Add back members as more code is compiled. |
134 #if !defined(OS_IOS) | 133 #if !defined(OS_IOS) |
135 #if defined(ENABLE_CONFIGURATION_POLICY) | 134 #if defined(ENABLE_CONFIGURATION_POLICY) |
136 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; | 135 scoped_ptr<policy::BrowserPolicyConnector> browser_policy_connector_; |
137 #else | 136 #else |
138 scoped_ptr<policy::PolicyService> policy_service_; | 137 scoped_ptr<policy::PolicyService> policy_service_; |
139 #endif | 138 #endif |
140 scoped_ptr<ProfileManager> profile_manager_; | 139 scoped_ptr<ProfileManager> profile_manager_; |
141 scoped_ptr<NotificationUIManager> notification_ui_manager_; | 140 scoped_ptr<NotificationUIManager> notification_ui_manager_; |
142 | 141 |
143 #if defined(ENABLE_FULL_PRINTING) | 142 #if defined(ENABLE_FULL_PRINTING) |
144 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; | 143 scoped_ptr<printing::BackgroundPrintingManager> background_printing_manager_; |
145 scoped_refptr<printing::PrintPreviewDialogController> | 144 scoped_refptr<printing::PrintPreviewDialogController> |
146 print_preview_dialog_controller_; | 145 print_preview_dialog_controller_; |
147 #endif | 146 #endif |
148 | 147 |
149 scoped_ptr<prerender::PrerenderTracker> prerender_tracker_; | 148 scoped_ptr<prerender::PrerenderTracker> prerender_tracker_; |
150 scoped_ptr<RenderWidgetSnapshotTaker> render_widget_snapshot_taker_; | 149 scoped_ptr<RenderWidgetSnapshotTaker> render_widget_snapshot_taker_; |
151 scoped_refptr<SafeBrowsingService> sb_service_; | 150 scoped_refptr<SafeBrowsingService> sb_service_; |
152 scoped_ptr<BookmarkPromptController> bookmark_prompt_controller_; | 151 scoped_ptr<BookmarkPromptController> bookmark_prompt_controller_; |
153 #endif // !defined(OS_IOS) | 152 #endif // !defined(OS_IOS) |
154 | 153 |
155 #if !defined(OS_IOS) && !defined(OS_ANDROID) | 154 #if !defined(OS_IOS) && !defined(OS_ANDROID) |
156 scoped_ptr<chrome::StorageMonitor> storage_monitor_; | 155 scoped_ptr<StorageMonitor> storage_monitor_; |
157 scoped_ptr<chrome::MediaFileSystemRegistry> media_file_system_registry_; | 156 scoped_ptr<MediaFileSystemRegistry> media_file_system_registry_; |
158 #endif | 157 #endif |
159 | 158 |
160 // The following objects are not owned by TestingBrowserProcess: | 159 // The following objects are not owned by TestingBrowserProcess: |
161 PrefService* local_state_; | 160 PrefService* local_state_; |
162 IOThread* io_thread_; | 161 IOThread* io_thread_; |
163 net::URLRequestContextGetter* system_request_context_; | 162 net::URLRequestContextGetter* system_request_context_; |
164 | 163 |
165 scoped_ptr<BrowserProcessPlatformPart> platform_part_; | 164 scoped_ptr<BrowserProcessPlatformPart> platform_part_; |
166 | 165 |
167 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); | 166 DISALLOW_COPY_AND_ASSIGN(TestingBrowserProcess); |
168 }; | 167 }; |
169 | 168 |
170 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ | 169 #endif // CHROME_TEST_BASE_TESTING_BROWSER_PROCESS_H_ |
OLD | NEW |