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/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 void BlockUntilHistoryIndexIsRefreshed(); | 166 void BlockUntilHistoryIndexIsRefreshed(); |
167 | 167 |
168 // Blocks until TopSites finishes loading. | 168 // Blocks until TopSites finishes loading. |
169 void BlockUntilTopSitesLoaded(); | 169 void BlockUntilTopSitesLoaded(); |
170 | 170 |
171 TestingPrefServiceSyncable* GetTestingPrefService(); | 171 TestingPrefServiceSyncable* GetTestingPrefService(); |
172 | 172 |
173 // content::BrowserContext | 173 // content::BrowserContext |
174 virtual base::FilePath GetPath() OVERRIDE; | 174 virtual base::FilePath GetPath() OVERRIDE; |
175 virtual scoped_refptr<base::SequencedTaskRunner> GetIOTaskRunner() OVERRIDE; | 175 virtual scoped_refptr<base::SequencedTaskRunner> GetIOTaskRunner() OVERRIDE; |
| 176 virtual scoped_refptr<base::DeferredSequencedTaskRunner> |
| 177 GetBookmarksTaskRunner() OVERRIDE; |
176 virtual bool IsOffTheRecord() const OVERRIDE; | 178 virtual bool IsOffTheRecord() const OVERRIDE; |
177 virtual content::DownloadManagerDelegate* | 179 virtual content::DownloadManagerDelegate* |
178 GetDownloadManagerDelegate() OVERRIDE; | 180 GetDownloadManagerDelegate() OVERRIDE; |
179 // Returns a testing ContextGetter (if one has been created via | 181 // Returns a testing ContextGetter (if one has been created via |
180 // CreateRequestContext) or NULL. This is not done on-demand for two reasons: | 182 // CreateRequestContext) or NULL. This is not done on-demand for two reasons: |
181 // (1) Some tests depend on GetRequestContext() returning NULL. (2) Because | 183 // (1) Some tests depend on GetRequestContext() returning NULL. (2) Because |
182 // of the special memory management considerations for the | 184 // of the special memory management considerations for the |
183 // TestURLRequestContextGetter class, many tests would find themseleves | 185 // TestURLRequestContextGetter class, many tests would find themseleves |
184 // leaking if they called this method without the necessary IO thread. This | 186 // leaking if they called this method without the necessary IO thread. This |
185 // getter is currently only capable of returning a Context that helps test | 187 // getter is currently only capable of returning a Context that helps test |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 325 |
324 bool incognito_; | 326 bool incognito_; |
325 scoped_ptr<Profile> incognito_profile_; | 327 scoped_ptr<Profile> incognito_profile_; |
326 Profile* original_profile_; | 328 Profile* original_profile_; |
327 | 329 |
328 // Did the last session exit cleanly? Default is true. | 330 // Did the last session exit cleanly? Default is true. |
329 bool last_session_exited_cleanly_; | 331 bool last_session_exited_cleanly_; |
330 | 332 |
331 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; | 333 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
332 | 334 |
| 335 scoped_refptr<base::DeferredSequencedTaskRunner> bookmarks_task_runner_; |
| 336 |
333 base::FilePath last_selected_directory_; | 337 base::FilePath last_selected_directory_; |
334 scoped_refptr<history::TopSites> top_sites_; // For history and thumbnails. | 338 scoped_refptr<history::TopSites> top_sites_; // For history and thumbnails. |
335 | 339 |
336 scoped_refptr<ExtensionSpecialStoragePolicy> | 340 scoped_refptr<ExtensionSpecialStoragePolicy> |
337 extension_special_storage_policy_; | 341 extension_special_storage_policy_; |
338 | 342 |
339 // The proxy prefs tracker. | 343 // The proxy prefs tracker. |
340 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; | 344 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; |
341 | 345 |
342 // We use a temporary directory to store testing profile data. In a multi- | 346 // We use a temporary directory to store testing profile data. In a multi- |
343 // profile environment, this is invalid and the directory is managed by the | 347 // profile environment, this is invalid and the directory is managed by the |
344 // TestingProfileManager. | 348 // TestingProfileManager. |
345 base::ScopedTempDir temp_dir_; | 349 base::ScopedTempDir temp_dir_; |
346 // The path to this profile. This will be valid in either of the two above | 350 // The path to this profile. This will be valid in either of the two above |
347 // cases. | 351 // cases. |
348 base::FilePath profile_path_; | 352 base::FilePath profile_path_; |
349 | 353 |
350 // We keep a weak pointer to the dependency manager we want to notify on our | 354 // We keep a weak pointer to the dependency manager we want to notify on our |
351 // death. Defaults to the Singleton implementation but overridable for | 355 // death. Defaults to the Singleton implementation but overridable for |
352 // testing. | 356 // testing. |
353 ProfileDependencyManager* profile_dependency_manager_; | 357 ProfileDependencyManager* profile_dependency_manager_; |
354 | 358 |
355 scoped_ptr<content::MockResourceContext> resource_context_; | 359 scoped_ptr<content::MockResourceContext> resource_context_; |
356 | 360 |
357 // Weak pointer to a delegate for indicating that a profile was created. | 361 // Weak pointer to a delegate for indicating that a profile was created. |
358 Delegate* delegate_; | 362 Delegate* delegate_; |
359 }; | 363 }; |
360 | 364 |
361 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ | 365 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ |
OLD | NEW |