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" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "components/domain_reliability/clear_mode.h" |
14 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 15 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 class MockResourceContext; | 18 class MockResourceContext; |
18 } | 19 } |
19 | 20 |
20 namespace extensions { | 21 namespace extensions { |
21 class ExtensionPrefs; | 22 class ExtensionPrefs; |
22 } | 23 } |
23 | 24 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 void DestroyHistoryService(); | 176 void DestroyHistoryService(); |
176 | 177 |
177 // Creates TopSites. This returns immediately, and top sites may not be | 178 // Creates TopSites. This returns immediately, and top sites may not be |
178 // loaded. Use BlockUntilTopSitesLoaded to ensure TopSites has finished | 179 // loaded. Use BlockUntilTopSitesLoaded to ensure TopSites has finished |
179 // loading. | 180 // loading. |
180 void CreateTopSites(); | 181 void CreateTopSites(); |
181 | 182 |
182 // Shuts down and nulls out the reference to TopSites. | 183 // Shuts down and nulls out the reference to TopSites. |
183 void DestroyTopSites(); | 184 void DestroyTopSites(); |
184 | 185 |
185 // Creates the BookmkarBarModel. If not invoked the bookmark bar model is | 186 // Creates the BookmarkBarModel. If not invoked the bookmark bar model is |
186 // NULL. If |delete_file| is true, the bookmarks file is deleted first, then | 187 // NULL. If |delete_file| is true, the bookmarks file is deleted first, then |
187 // the model is created. As TestingProfile deletes the directory containing | 188 // the model is created. As TestingProfile deletes the directory containing |
188 // the files used by HistoryService, the boolean only matters if you're | 189 // the files used by HistoryService, the boolean only matters if you're |
189 // recreating the BookmarkModel. | 190 // recreating the BookmarkModel. |
190 // | 191 // |
191 // NOTE: this does not block until the bookmarks are loaded. For that use | 192 // NOTE: this does not block until the bookmarks are loaded. For that use |
192 // WaitForBookmarkModelToLoad(). | 193 // WaitForBookmarkModelToLoad(). |
193 void CreateBookmarkModel(bool delete_file); | 194 void CreateBookmarkModel(bool delete_file); |
194 | 195 |
195 // Creates a WebDataService. If not invoked, the web data service is NULL. | 196 // Creates a WebDataService. If not invoked, the web data service is NULL. |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 343 |
343 // Schedules a task on the history backend and runs a nested loop until the | 344 // Schedules a task on the history backend and runs a nested loop until the |
344 // task is processed. This has the effect of blocking the caller until the | 345 // task is processed. This has the effect of blocking the caller until the |
345 // history service processes all pending requests. | 346 // history service processes all pending requests. |
346 void BlockUntilHistoryProcessesPendingRequests(); | 347 void BlockUntilHistoryProcessesPendingRequests(); |
347 | 348 |
348 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE; | 349 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE; |
349 virtual void ClearNetworkingHistorySince( | 350 virtual void ClearNetworkingHistorySince( |
350 base::Time time, | 351 base::Time time, |
351 const base::Closure& completion) OVERRIDE; | 352 const base::Closure& completion) OVERRIDE; |
| 353 virtual void ClearDomainReliabilityMonitor( |
| 354 domain_reliability::DomainReliabilityClearMode mode, |
| 355 const base::Closure& completion) OVERRIDE; |
352 virtual GURL GetHomePage() OVERRIDE; | 356 virtual GURL GetHomePage() OVERRIDE; |
353 | 357 |
354 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE; | 358 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE; |
355 | 359 |
356 void set_profile_name(const std::string& profile_name) { | 360 void set_profile_name(const std::string& profile_name) { |
357 profile_name_ = profile_name; | 361 profile_name_ = profile_name; |
358 } | 362 } |
359 | 363 |
360 protected: | 364 protected: |
361 base::Time start_time_; | 365 base::Time start_time_; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 437 |
434 // Weak pointer to a delegate for indicating that a profile was created. | 438 // Weak pointer to a delegate for indicating that a profile was created. |
435 Delegate* delegate_; | 439 Delegate* delegate_; |
436 | 440 |
437 std::string profile_name_; | 441 std::string profile_name_; |
438 | 442 |
439 scoped_ptr<policy::PolicyService> policy_service_; | 443 scoped_ptr<policy::PolicyService> policy_service_; |
440 }; | 444 }; |
441 | 445 |
442 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ | 446 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ |
OLD | NEW |