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 #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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 class CookieMonster; | 30 class CookieMonster; |
31 class URLRequestContextGetter; | 31 class URLRequestContextGetter; |
32 } | 32 } |
33 | 33 |
34 namespace quota { | 34 namespace quota { |
35 class SpecialStoragePolicy; | 35 class SpecialStoragePolicy; |
36 } | 36 } |
37 | 37 |
38 class CommandLine; | 38 class CommandLine; |
39 class ExtensionSpecialStoragePolicy; | 39 class ExtensionSpecialStoragePolicy; |
40 class FaviconService; | |
41 class HistoryService; | |
42 class HostContentSettingsMap; | 40 class HostContentSettingsMap; |
43 class PrefService; | 41 class PrefService; |
44 class ProfileDependencyManager; | 42 class ProfileDependencyManager; |
45 class ProfileSyncService; | 43 class ProfileSyncService; |
46 class TemplateURLService; | 44 class TemplateURLService; |
47 class TestingPrefService; | 45 class TestingPrefService; |
48 | 46 |
49 class TestingProfile : public Profile { | 47 class TestingProfile : public Profile { |
50 public: | 48 public: |
51 // Profile directory name for the test user. This is "Default" on most | 49 // Profile directory name for the test user. This is "Default" on most |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void CreateFaviconService(); | 132 void CreateFaviconService(); |
135 | 133 |
136 // Creates the history service. If |delete_file| is true, the history file is | 134 // Creates the history service. If |delete_file| is true, the history file is |
137 // deleted first, then the HistoryService is created. As TestingProfile | 135 // deleted first, then the HistoryService is created. As TestingProfile |
138 // deletes the directory containing the files used by HistoryService, this | 136 // deletes the directory containing the files used by HistoryService, this |
139 // only matters if you're recreating the HistoryService. If |no_db| is true, | 137 // only matters if you're recreating the HistoryService. If |no_db| is true, |
140 // the history backend will fail to initialize its database; this is useful | 138 // the history backend will fail to initialize its database; this is useful |
141 // for testing error conditions. | 139 // for testing error conditions. |
142 void CreateHistoryService(bool delete_file, bool no_db); | 140 void CreateHistoryService(bool delete_file, bool no_db); |
143 | 141 |
144 // Initializes the history service. If |no_db| is true, the history backend | |
145 // will fail to initialize its database; this is useful for testing error | |
146 // conditions. Returns true upon success. | |
147 virtual bool InitHistoryService(HistoryService* history_service, | |
148 bool no_db); | |
149 | |
150 // Shuts down and nulls out the reference to HistoryService. | 142 // Shuts down and nulls out the reference to HistoryService. |
151 void DestroyHistoryService(); | 143 void DestroyHistoryService(); |
152 | 144 |
153 // Creates TopSites. This returns immediately, and top sites may not be | 145 // Creates TopSites. This returns immediately, and top sites may not be |
154 // loaded. Use BlockUntilTopSitesLoaded to ensure TopSites has finished | 146 // loaded. Use BlockUntilTopSitesLoaded to ensure TopSites has finished |
155 // loading. | 147 // loading. |
156 void CreateTopSites(); | 148 void CreateTopSites(); |
157 | 149 |
158 // Shuts down and nulls out the reference to TopSites. | 150 // Shuts down and nulls out the reference to TopSites. |
159 void DestroyTopSites(); | 151 void DestroyTopSites(); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 // testing. | 364 // testing. |
373 ProfileDependencyManager* profile_dependency_manager_; | 365 ProfileDependencyManager* profile_dependency_manager_; |
374 | 366 |
375 scoped_ptr<content::MockResourceContext> resource_context_; | 367 scoped_ptr<content::MockResourceContext> resource_context_; |
376 | 368 |
377 // Weak pointer to a delegate for indicating that a profile was created. | 369 // Weak pointer to a delegate for indicating that a profile was created. |
378 Delegate* delegate_; | 370 Delegate* delegate_; |
379 }; | 371 }; |
380 | 372 |
381 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ | 373 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ |
OLD | NEW |