OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // TestingPrefService takes ownership of |prefs|. | 184 // TestingPrefService takes ownership of |prefs|. |
185 void SetPrefService(PrefService* prefs); | 185 void SetPrefService(PrefService* prefs); |
186 virtual PrefService* GetPrefs(); | 186 virtual PrefService* GetPrefs(); |
187 virtual TemplateURLFetcher* GetTemplateURLFetcher(); | 187 virtual TemplateURLFetcher* GetTemplateURLFetcher(); |
188 virtual history::TopSites* GetTopSites(); | 188 virtual history::TopSites* GetTopSites(); |
189 virtual history::TopSites* GetTopSitesWithoutCreating(); | 189 virtual history::TopSites* GetTopSitesWithoutCreating(); |
190 virtual DownloadManager* GetDownloadManager(); | 190 virtual DownloadManager* GetDownloadManager(); |
191 virtual fileapi::FileSystemContext* GetFileSystemContext(); | 191 virtual fileapi::FileSystemContext* GetFileSystemContext(); |
192 virtual void SetQuotaManager(quota::QuotaManager* manager); | 192 virtual void SetQuotaManager(quota::QuotaManager* manager); |
193 virtual quota::QuotaManager* GetQuotaManager(); | 193 virtual quota::QuotaManager* GetQuotaManager(); |
194 virtual bool HasCreatedDownloadManager() const; | |
195 | 194 |
196 // Returns a testing ContextGetter (if one has been created via | 195 // Returns a testing ContextGetter (if one has been created via |
197 // CreateRequestContext) or NULL. This is not done on-demand for two reasons: | 196 // CreateRequestContext) or NULL. This is not done on-demand for two reasons: |
198 // (1) Some tests depend on GetRequestContext() returning NULL. (2) Because | 197 // (1) Some tests depend on GetRequestContext() returning NULL. (2) Because |
199 // of the special memory management considerations for the | 198 // of the special memory management considerations for the |
200 // TestURLRequestContextGetter class, many tests would find themseleves | 199 // TestURLRequestContextGetter class, many tests would find themseleves |
201 // leaking if they called this method without the necessary IO thread. This | 200 // leaking if they called this method without the necessary IO thread. This |
202 // getter is currently only capable of returning a Context that helps test | 201 // getter is currently only capable of returning a Context that helps test |
203 // the CookieMonster. See implementation comments for more details. | 202 // the CookieMonster. See implementation comments for more details. |
204 virtual net::URLRequestContextGetter* GetRequestContext(); | 203 virtual net::URLRequestContextGetter* GetRequestContext(); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // it in the content module. | 286 // it in the content module. |
288 quota::SpecialStoragePolicy* GetSpecialStoragePolicy(); | 287 quota::SpecialStoragePolicy* GetSpecialStoragePolicy(); |
289 | 288 |
290 protected: | 289 protected: |
291 base::Time start_time_; | 290 base::Time start_time_; |
292 scoped_ptr<PrefService> prefs_; | 291 scoped_ptr<PrefService> prefs_; |
293 // ref only for right type, lifecycle is managed by prefs_ | 292 // ref only for right type, lifecycle is managed by prefs_ |
294 TestingPrefService* testing_prefs_; | 293 TestingPrefService* testing_prefs_; |
295 | 294 |
296 private: | 295 private: |
297 virtual void SetDownloadManagerDelegate( | |
298 ChromeDownloadManagerDelegate* delegate); | |
299 | |
300 // Common initialization between the two constructors. | 296 // Common initialization between the two constructors. |
301 void Init(); | 297 void Init(); |
302 | 298 |
303 // Destroys favicon service if it has been created. | 299 // Destroys favicon service if it has been created. |
304 void DestroyFaviconService(); | 300 void DestroyFaviconService(); |
305 | 301 |
306 // If the webdata service has been created, it is destroyed. This is invoked | 302 // If the webdata service has been created, it is destroyed. This is invoked |
307 // from the destructor. | 303 // from the destructor. |
308 void DestroyWebDataService(); | 304 void DestroyWebDataService(); |
309 | 305 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 // testing. | 399 // testing. |
404 ProfileDependencyManager* profile_dependency_manager_; | 400 ProfileDependencyManager* profile_dependency_manager_; |
405 | 401 |
406 scoped_refptr<ChromeAppCacheService> appcache_service_; | 402 scoped_refptr<ChromeAppCacheService> appcache_service_; |
407 | 403 |
408 // The QuotaManager, only available if set explicitly via SetQuotaManager. | 404 // The QuotaManager, only available if set explicitly via SetQuotaManager. |
409 scoped_refptr<quota::QuotaManager> quota_manager_; | 405 scoped_refptr<quota::QuotaManager> quota_manager_; |
410 }; | 406 }; |
411 | 407 |
412 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ | 408 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ |
OLD | NEW |