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

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

Issue 8135017: Refactor downloads into a ProfileKeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged to LKGR to run try bots. Created 9 years, 2 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
OLDNEW
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
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 // it in the content module. 287 // it in the content module.
289 quota::SpecialStoragePolicy* GetSpecialStoragePolicy(); 288 quota::SpecialStoragePolicy* GetSpecialStoragePolicy();
290 289
291 protected: 290 protected:
292 base::Time start_time_; 291 base::Time start_time_;
293 scoped_ptr<PrefService> prefs_; 292 scoped_ptr<PrefService> prefs_;
294 // ref only for right type, lifecycle is managed by prefs_ 293 // ref only for right type, lifecycle is managed by prefs_
295 TestingPrefService* testing_prefs_; 294 TestingPrefService* testing_prefs_;
296 295
297 private: 296 private:
298 virtual void SetDownloadManagerDelegate(
299 ChromeDownloadManagerDelegate* delegate);
300
301 // Common initialization between the two constructors. 297 // Common initialization between the two constructors.
302 void Init(); 298 void Init();
303 299
304 // Destroys favicon service if it has been created. 300 // Destroys favicon service if it has been created.
305 void DestroyFaviconService(); 301 void DestroyFaviconService();
306 302
307 // If the webdata service has been created, it is destroyed. This is invoked 303 // If the webdata service has been created, it is destroyed. This is invoked
308 // from the destructor. 304 // from the destructor.
309 void DestroyWebDataService(); 305 void DestroyWebDataService();
310 306
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 // testing. 402 // testing.
407 ProfileDependencyManager* profile_dependency_manager_; 403 ProfileDependencyManager* profile_dependency_manager_;
408 404
409 scoped_refptr<ChromeAppCacheService> appcache_service_; 405 scoped_refptr<ChromeAppCacheService> appcache_service_;
410 406
411 // The QuotaManager, only available if set explicitly via SetQuotaManager. 407 // The QuotaManager, only available if set explicitly via SetQuotaManager.
412 scoped_refptr<quota::QuotaManager> quota_manager_; 408 scoped_refptr<quota::QuotaManager> quota_manager_;
413 }; 409 };
414 410
415 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ 411 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698