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

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

Issue 11238034: Added completion notification to Profile's ClearNetworkingHistorySince. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missing newline at EOF. Created 8 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) 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"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/scoped_temp_dir.h" 12 #include "base/scoped_temp_dir.h"
13 #include "base/timer.h" 13 #include "base/timer.h"
14 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 14 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/profiles/profile_impl_io_data.h"
16 17
17 namespace content { 18 namespace content {
18 class MockResourceContext; 19 class MockResourceContext;
19 } 20 }
20 21
21 namespace extensions { 22 namespace extensions {
22 class ExtensionPrefs; 23 class ExtensionPrefs;
23 } 24 }
24 25
25 namespace history { 26 namespace history {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 170
170 // Blocks until the HistoryService finishes restoring its in-memory cache. 171 // Blocks until the HistoryService finishes restoring its in-memory cache.
171 // This is NOT invoked from CreateHistoryService. 172 // This is NOT invoked from CreateHistoryService.
172 void BlockUntilHistoryIndexIsRefreshed(); 173 void BlockUntilHistoryIndexIsRefreshed();
173 174
174 // Blocks until TopSites finishes loading. 175 // Blocks until TopSites finishes loading.
175 void BlockUntilTopSitesLoaded(); 176 void BlockUntilTopSitesLoaded();
176 177
177 TestingPrefService* GetTestingPrefService(); 178 TestingPrefService* GetTestingPrefService();
178 179
180 // Initializes a skeleton ProfileIOData instance required for some unit tests.
181 void CreateSkeletonIODataForTesting();
182
179 // content::BrowserContext 183 // content::BrowserContext
180 virtual FilePath GetPath() OVERRIDE; 184 virtual FilePath GetPath() OVERRIDE;
181 virtual bool IsOffTheRecord() const OVERRIDE; 185 virtual bool IsOffTheRecord() const OVERRIDE;
182 virtual content::DownloadManagerDelegate* 186 virtual content::DownloadManagerDelegate*
183 GetDownloadManagerDelegate() OVERRIDE; 187 GetDownloadManagerDelegate() OVERRIDE;
184 // Returns a testing ContextGetter (if one has been created via 188 // Returns a testing ContextGetter (if one has been created via
185 // CreateRequestContext) or NULL. This is not done on-demand for two reasons: 189 // CreateRequestContext) or NULL. This is not done on-demand for two reasons:
186 // (1) Some tests depend on GetRequestContext() returning NULL. (2) Because 190 // (1) Some tests depend on GetRequestContext() returning NULL. (2) Because
187 // of the special memory management considerations for the 191 // of the special memory management considerations for the
188 // TestURLRequestContextGetter class, many tests would find themseleves 192 // TestURLRequestContextGetter class, many tests would find themseleves
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 #endif // defined(OS_CHROMEOS) 291 #endif // defined(OS_CHROMEOS)
288 292
289 virtual PrefProxyConfigTracker* GetProxyConfigTracker() OVERRIDE; 293 virtual PrefProxyConfigTracker* GetProxyConfigTracker() OVERRIDE;
290 294
291 // Schedules a task on the history backend and runs a nested loop until the 295 // Schedules a task on the history backend and runs a nested loop until the
292 // task is processed. This has the effect of blocking the caller until the 296 // task is processed. This has the effect of blocking the caller until the
293 // history service processes all pending requests. 297 // history service processes all pending requests.
294 void BlockUntilHistoryProcessesPendingRequests(); 298 void BlockUntilHistoryProcessesPendingRequests();
295 299
296 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE; 300 virtual chrome_browser_net::Predictor* GetNetworkPredictor() OVERRIDE;
297 virtual void ClearNetworkingHistorySince(base::Time time) OVERRIDE; 301 virtual void ClearNetworkingHistorySince(
302 base::Time time,
303 const base::Closure& completion) OVERRIDE;
298 virtual GURL GetHomePage() OVERRIDE; 304 virtual GURL GetHomePage() OVERRIDE;
299 305
300 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE; 306 virtual PrefService* GetOffTheRecordPrefs() OVERRIDE;
301 307
302 protected: 308 protected:
303 base::Time start_time_; 309 base::Time start_time_;
304 scoped_ptr<PrefService> prefs_; 310 scoped_ptr<PrefService> prefs_;
305 // ref only for right type, lifecycle is managed by prefs_ 311 // ref only for right type, lifecycle is managed by prefs_
306 TestingPrefService* testing_prefs_; 312 TestingPrefService* testing_prefs_;
307 313
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 352
347 scoped_refptr<ExtensionSpecialStoragePolicy> 353 scoped_refptr<ExtensionSpecialStoragePolicy>
348 extension_special_storage_policy_; 354 extension_special_storage_policy_;
349 355
350 // The proxy prefs tracker. 356 // The proxy prefs tracker.
351 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; 357 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;
352 358
353 // UserCloudPolicyManager returned by GetUserCloudPolicyManager(). 359 // UserCloudPolicyManager returned by GetUserCloudPolicyManager().
354 scoped_ptr<policy::UserCloudPolicyManager> user_cloud_policy_manager_; 360 scoped_ptr<policy::UserCloudPolicyManager> user_cloud_policy_manager_;
355 361
362 // A skeleton ProfileIOData instance, with very limited functionality, needed
363 // for some unit tests.
364 // Initialized on-demand by callingCreateSkeletonIODataForTesting().
battre 2012/10/23 08:38:33 nit: space after calling.
engedy 2012/10/23 10:40:09 Done.
365 scoped_ptr<ProfileImplIOData::Handle> io_data_;
366
356 // We use a temporary directory to store testing profile data. In a multi- 367 // We use a temporary directory to store testing profile data. In a multi-
357 // profile environment, this is invalid and the directory is managed by the 368 // profile environment, this is invalid and the directory is managed by the
358 // TestingProfileManager. 369 // TestingProfileManager.
359 ScopedTempDir temp_dir_; 370 ScopedTempDir temp_dir_;
360 // The path to this profile. This will be valid in either of the two above 371 // The path to this profile. This will be valid in either of the two above
361 // cases. 372 // cases.
362 FilePath profile_path_; 373 FilePath profile_path_;
363 374
364 // We keep a weak pointer to the dependency manager we want to notify on our 375 // We keep a weak pointer to the dependency manager we want to notify on our
365 // death. Defaults to the Singleton implementation but overridable for 376 // death. Defaults to the Singleton implementation but overridable for
366 // testing. 377 // testing.
367 ProfileDependencyManager* profile_dependency_manager_; 378 ProfileDependencyManager* profile_dependency_manager_;
368 379
369 scoped_ptr<content::MockResourceContext> resource_context_; 380 scoped_ptr<content::MockResourceContext> resource_context_;
370 381
371 // Weak pointer to a delegate for indicating that a profile was created. 382 // Weak pointer to a delegate for indicating that a profile was created.
372 Delegate* delegate_; 383 Delegate* delegate_;
373 }; 384 };
374 385
375 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ 386 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698