Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: chrome/test/base/testing_profile.h

Issue 9369013: Take extensions out of Profile into a profile-keyed service, ExtensionSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rerebase Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/base/testing_profile.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CHROME_TEST_BASE_TESTING_PROFILE_H_ 5 #ifndef CHROME_TEST_BASE_TESTING_PROFILE_H_
6 #define CHROME_TEST_BASE_TESTING_PROFILE_H_ 6 #define CHROME_TEST_BASE_TESTING_PROFILE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // TemplateURLFetcher is NULL. 126 // TemplateURLFetcher is NULL.
127 void CreateTemplateURLFetcher(); 127 void CreateTemplateURLFetcher();
128 128
129 // Creates a TemplateURLService. If not invoked, the TemplateURLService is 129 // Creates a TemplateURLService. If not invoked, the TemplateURLService is
130 // NULL. 130 // NULL.
131 void CreateTemplateURLService(); 131 void CreateTemplateURLService();
132 132
133 // Blocks until TempalteURLService finishes loading. 133 // Blocks until TempalteURLService finishes loading.
134 void BlockUntilTemplateURLServiceLoaded(); 134 void BlockUntilTemplateURLServiceLoaded();
135 135
136 // Creates an ExtensionProcessManager. If not invoked, the
137 // ExtensionProcessManager is NULL.
138 void CreateExtensionProcessManager();
139
140 // Creates an ExtensionService initialized with the testing profile and
141 // returns it. The profile keeps its own copy of a scoped_refptr to the
142 // ExtensionService to make sure that is still alive to be notified when the
143 // profile is destroyed.
144 ExtensionService* CreateExtensionService(const CommandLine* command_line,
145 const FilePath& install_directory,
146 bool autoupdate_enabled);
147
148 TestingPrefService* GetTestingPrefService(); 136 TestingPrefService* GetTestingPrefService();
149 137
150 // content::BrowserContext 138 // content::BrowserContext
151 virtual FilePath GetPath() OVERRIDE; 139 virtual FilePath GetPath() OVERRIDE;
152 virtual bool IsOffTheRecord() const OVERRIDE; 140 virtual bool IsOffTheRecord() const OVERRIDE;
153 virtual content::DownloadManager* GetDownloadManager() OVERRIDE; 141 virtual content::DownloadManager* GetDownloadManager() OVERRIDE;
154 // Returns a testing ContextGetter (if one has been created via 142 // Returns a testing ContextGetter (if one has been created via
155 // CreateRequestContext) or NULL. This is not done on-demand for two reasons: 143 // CreateRequestContext) or NULL. This is not done on-demand for two reasons:
156 // (1) Some tests depend on GetRequestContext() returning NULL. (2) Because 144 // (1) Some tests depend on GetRequestContext() returning NULL. (2) Because
157 // of the special memory management considerations for the 145 // of the special memory management considerations for the
(...skipping 15 matching lines...) Expand all
173 virtual std::string GetProfileName() OVERRIDE; 161 virtual std::string GetProfileName() OVERRIDE;
174 void set_incognito(bool incognito) { incognito_ = incognito; } 162 void set_incognito(bool incognito) { incognito_ = incognito; }
175 // Assumes ownership. 163 // Assumes ownership.
176 virtual void SetOffTheRecordProfile(Profile* profile); 164 virtual void SetOffTheRecordProfile(Profile* profile);
177 virtual Profile* GetOffTheRecordProfile() OVERRIDE; 165 virtual Profile* GetOffTheRecordProfile() OVERRIDE;
178 virtual void DestroyOffTheRecordProfile() OVERRIDE {} 166 virtual void DestroyOffTheRecordProfile() OVERRIDE {}
179 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() OVERRIDE; 167 virtual GAIAInfoUpdateService* GetGAIAInfoUpdateService() OVERRIDE;
180 virtual bool HasOffTheRecordProfile() OVERRIDE; 168 virtual bool HasOffTheRecordProfile() OVERRIDE;
181 virtual Profile* GetOriginalProfile() OVERRIDE; 169 virtual Profile* GetOriginalProfile() OVERRIDE;
182 virtual VisitedLinkMaster* GetVisitedLinkMaster() OVERRIDE; 170 virtual VisitedLinkMaster* GetVisitedLinkMaster() OVERRIDE;
171 virtual ExtensionPrefValueMap* GetExtensionPrefValueMap() OVERRIDE;
183 virtual ExtensionService* GetExtensionService() OVERRIDE; 172 virtual ExtensionService* GetExtensionService() OVERRIDE;
184 virtual UserScriptMaster* GetUserScriptMaster() OVERRIDE; 173 virtual UserScriptMaster* GetUserScriptMaster() OVERRIDE;
185 virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() OVERRIDE;
186 virtual ExtensionProcessManager* GetExtensionProcessManager() OVERRIDE; 174 virtual ExtensionProcessManager* GetExtensionProcessManager() OVERRIDE;
187 virtual ExtensionMessageService* GetExtensionMessageService() OVERRIDE;
188 virtual ExtensionEventRouter* GetExtensionEventRouter() OVERRIDE; 175 virtual ExtensionEventRouter* GetExtensionEventRouter() OVERRIDE;
189 void SetExtensionSpecialStoragePolicy( 176 void SetExtensionSpecialStoragePolicy(
190 ExtensionSpecialStoragePolicy* extension_special_storage_policy); 177 ExtensionSpecialStoragePolicy* extension_special_storage_policy);
191 virtual ExtensionSpecialStoragePolicy* 178 virtual ExtensionSpecialStoragePolicy*
192 GetExtensionSpecialStoragePolicy() OVERRIDE; 179 GetExtensionSpecialStoragePolicy() OVERRIDE;
193 virtual FaviconService* GetFaviconService(ServiceAccessType access) OVERRIDE; 180 virtual FaviconService* GetFaviconService(ServiceAccessType access) OVERRIDE;
194 virtual HistoryService* GetHistoryService(ServiceAccessType access) OVERRIDE; 181 virtual HistoryService* GetHistoryService(ServiceAccessType access) OVERRIDE;
195 virtual HistoryService* GetHistoryServiceWithoutCreating() OVERRIDE; 182 virtual HistoryService* GetHistoryServiceWithoutCreating() OVERRIDE;
196 // The CookieMonster will only be returned if a Context has been created. Do 183 // The CookieMonster will only be returned if a Context has been created. Do
197 // this by calling CreateRequestContext(). See the note at GetRequestContext 184 // this by calling CreateRequestContext(). See the note at GetRequestContext
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 221 }
235 virtual void MergeResourceString(int message_id, 222 virtual void MergeResourceString(int message_id,
236 std::wstring* output_string) {} 223 std::wstring* output_string) {}
237 virtual void MergeResourceInteger(int message_id, int* output_value) {} 224 virtual void MergeResourceInteger(int message_id, int* output_value) {}
238 virtual void MergeResourceBoolean(int message_id, bool* output_value) {} 225 virtual void MergeResourceBoolean(int message_id, bool* output_value) {}
239 virtual BookmarkModel* GetBookmarkModel() OVERRIDE; 226 virtual BookmarkModel* GetBookmarkModel() OVERRIDE;
240 virtual bool IsSameProfile(Profile *p) OVERRIDE; 227 virtual bool IsSameProfile(Profile *p) OVERRIDE;
241 virtual base::Time GetStartTime() const OVERRIDE; 228 virtual base::Time GetStartTime() const OVERRIDE;
242 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() OVERRIDE; 229 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() OVERRIDE;
243 virtual void MarkAsCleanShutdown() OVERRIDE {} 230 virtual void MarkAsCleanShutdown() OVERRIDE {}
244 virtual void InitExtensions(bool extensions_enabled) OVERRIDE {}
245 virtual void InitPromoResources() OVERRIDE {} 231 virtual void InitPromoResources() OVERRIDE {}
246 virtual void InitRegisteredProtocolHandlers() OVERRIDE {} 232 virtual void InitRegisteredProtocolHandlers() OVERRIDE {}
247 233
248 virtual FilePath last_selected_directory() OVERRIDE; 234 virtual FilePath last_selected_directory() OVERRIDE;
249 virtual void set_last_selected_directory(const FilePath& path) OVERRIDE; 235 virtual void set_last_selected_directory(const FilePath& path) OVERRIDE;
250 #if defined(OS_CHROMEOS) 236 #if defined(OS_CHROMEOS)
251 virtual void SetupChromeOSEnterpriseExtensionObserver() OVERRIDE { 237 virtual void SetupChromeOSEnterpriseExtensionObserver() OVERRIDE {
252 } 238 }
253 virtual void InitChromeOSPreferences() OVERRIDE { 239 virtual void InitChromeOSPreferences() OVERRIDE {
254 } 240 }
255 virtual void ChangeAppLocale(const std::string&, 241 virtual void ChangeAppLocale(const std::string&,
256 AppLocaleChangedVia) OVERRIDE { 242 AppLocaleChangedVia) OVERRIDE {
257 } 243 }
258 virtual void OnLogin() OVERRIDE { 244 virtual void OnLogin() OVERRIDE {
259 } 245 }
260 #endif // defined(OS_CHROMEOS) 246 #endif // defined(OS_CHROMEOS)
261 247
262 virtual PrefProxyConfigTracker* GetProxyConfigTracker() OVERRIDE; 248 virtual PrefProxyConfigTracker* GetProxyConfigTracker() OVERRIDE;
263 249
264 // Schedules a task on the history backend and runs a nested loop until the 250 // Schedules a task on the history backend and runs a nested loop until the
265 // task is processed. This has the effect of blocking the caller until the 251 // task is processed. This has the effect of blocking the caller until the
266 // history service processes all pending requests. 252 // history service processes all pending requests.
267 void BlockUntilHistoryProcessesPendingRequests(); 253 void BlockUntilHistoryProcessesPendingRequests();
268 254
269 virtual TokenService* GetTokenService() OVERRIDE; 255 virtual TokenService* GetTokenService() OVERRIDE;
270 virtual ExtensionInfoMap* GetExtensionInfoMap() OVERRIDE;
271 virtual PromoCounter* GetInstantPromoCounter() OVERRIDE; 256 virtual PromoCounter* GetInstantPromoCounter() OVERRIDE;
272 virtual ChromeURLDataManager* GetChromeURLDataManager() OVERRIDE; 257 virtual ChromeURLDataManager* GetChromeURLDataManager() OVERRIDE;
273 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE; 258 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE;
274 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE; 259 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE;
275 virtual GURL GetHomePage() OVERRIDE; 260 virtual GURL GetHomePage() OVERRIDE;
276 261
277 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE; 262 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE;
278 263
279 protected: 264 protected:
280 base::Time start_time_; 265 base::Time start_time_;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 329
345 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; 330 scoped_refptr<HostContentSettingsMap> host_content_settings_map_;
346 scoped_refptr<content::GeolocationPermissionContext> 331 scoped_refptr<content::GeolocationPermissionContext>
347 geolocation_permission_context_; 332 geolocation_permission_context_;
348 333
349 scoped_refptr<content::SpeechInputPreferences> speech_input_preferences_; 334 scoped_refptr<content::SpeechInputPreferences> speech_input_preferences_;
350 335
351 FilePath last_selected_directory_; 336 FilePath last_selected_directory_;
352 scoped_refptr<history::TopSites> top_sites_; // For history and thumbnails. 337 scoped_refptr<history::TopSites> top_sites_; // For history and thumbnails.
353 338
354 // The Extension Preferences. Only created if CreateExtensionService is
355 // invoked.
356 scoped_ptr<ExtensionPrefs> extension_prefs_;
357
358 scoped_ptr<ExtensionService> extension_service_;
359
360 scoped_ptr<ExtensionProcessManager> extension_process_manager_;
361
362 scoped_ptr<ExtensionPrefValueMap> extension_pref_value_map_;
363
364 scoped_refptr<ExtensionSpecialStoragePolicy> 339 scoped_refptr<ExtensionSpecialStoragePolicy>
365 extension_special_storage_policy_; 340 extension_special_storage_policy_;
366 341
367 // The proxy prefs tracker. 342 // The proxy prefs tracker.
368 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; 343 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;
369 344
370 // We use a temporary directory to store testing profile data. In a multi- 345 // We use a temporary directory to store testing profile data. In a multi-
371 // profile environment, this is invalid and the directory is managed by the 346 // profile environment, this is invalid and the directory is managed by the
372 // TestingProfileManager. 347 // TestingProfileManager.
373 ScopedTempDir temp_dir_; 348 ScopedTempDir temp_dir_;
374 // The path to this profile. This will be valid in either of the two above 349 // The path to this profile. This will be valid in either of the two above
375 // cases. 350 // cases.
376 FilePath profile_path_; 351 FilePath profile_path_;
377 352
378 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_; 353 scoped_ptr<ChromeURLDataManager> chrome_url_data_manager_;
379 354
380 // We keep a weak pointer to the dependency manager we want to notify on our 355 // We keep a weak pointer to the dependency manager we want to notify on our
381 // death. Defaults to the Singleton implementation but overridable for 356 // death. Defaults to the Singleton implementation but overridable for
382 // testing. 357 // testing.
383 ProfileDependencyManager* profile_dependency_manager_; 358 ProfileDependencyManager* profile_dependency_manager_;
384 359
385 scoped_ptr<content::MockResourceContext> resource_context_; 360 scoped_ptr<content::MockResourceContext> resource_context_;
386 361
387 // Weak pointer to a delegate for indicating that a profile was created. 362 // Weak pointer to a delegate for indicating that a profile was created.
388 Delegate* delegate_; 363 Delegate* delegate_;
389 }; 364 };
390 365
391 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ 366 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/base/testing_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698