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

Unified Diff: chrome/test/base/testing_profile.cc

Issue 631253002: Refactor sending NOTIFICATION_HISTORY_URL_VISITED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests on Android Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/profile_sync_service_typed_url_unittest.cc ('k') | components/history.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/testing_profile.cc
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index 64d44dadcb5baeec2ba9eceff83d560f65d23a2f..61ced476aed838afbce588a2afc03d17b50ce777 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -470,8 +470,12 @@ void TestingProfile::CreateFaviconService() {
static KeyedService* BuildHistoryService(content::BrowserContext* context) {
Profile* profile = static_cast<Profile*>(context);
- return new HistoryService(ChromeHistoryClientFactory::GetForProfile(profile),
- profile);
+ ChromeHistoryClient* history_client =
+ ChromeHistoryClientFactory::GetForProfile(profile);
+ HistoryService* history_service = new HistoryService(history_client, profile);
+ if (history_client)
+ history_client->SetHistoryService(history_service);
+ return history_service;
}
bool TestingProfile::CreateHistoryService(bool delete_file, bool no_db) {
@@ -495,6 +499,13 @@ bool TestingProfile::CreateHistoryService(bool delete_file, bool no_db) {
}
void TestingProfile::DestroyHistoryService() {
+ // TODO(sdefresne): remove this once ChromeHistoryClient is no longer an
+ // HistoryServiceObserver, http://crbug.com/373326
+ ChromeHistoryClient* history_client =
+ ChromeHistoryClientFactory::GetForProfileWithoutCreating(this);
+ if (history_client)
+ history_client->Shutdown();
+
HistoryService* history_service =
HistoryServiceFactory::GetForProfileWithoutCreating(this);
if (!history_service)
« no previous file with comments | « chrome/browser/sync/profile_sync_service_typed_url_unittest.cc ('k') | components/history.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698