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