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

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

Issue 10795056: Remove last references to profile->GetHistory() and profile->GetBookmarkModel() (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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/test/base/testing_profile.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/testing_profile.cc
===================================================================
--- chrome/test/base/testing_profile.cc (revision 150466)
+++ chrome/test/base/testing_profile.cc (working copy)
@@ -420,15 +420,19 @@
}
void TestingProfile::BlockUntilBookmarkModelLoaded() {
- DCHECK(GetBookmarkModel());
- if (GetBookmarkModel()->IsLoaded())
+ // Only get the bookmark model if it actually exists since the caller of the
+ // test should explicitly call CreateBookmarkModel to build it.
+ BookmarkModel* bookmark_model =
+ BookmarkModelFactory::GetForProfileIfExists(this);
+ DCHECK(bookmark_model);
+ if (bookmark_model->IsLoaded())
return;
base::RunLoop run_loop;
BookmarkLoadObserver observer(content::GetQuitTaskForRunLoop(&run_loop));
- GetBookmarkModel()->AddObserver(&observer);
+ bookmark_model->AddObserver(&observer);
run_loop.Run();
- GetBookmarkModel()->RemoveObserver(&observer);
- DCHECK(GetBookmarkModel()->IsLoaded());
+ bookmark_model->RemoveObserver(&observer);
+ DCHECK(bookmark_model->IsLoaded());
}
// TODO(phajdan.jr): Doesn't this hang if Top Sites are already loaded?
@@ -436,7 +440,7 @@
content::WindowedNotificationObserver top_sites_loaded_observer(
chrome::NOTIFICATION_TOP_SITES_LOADED,
content::NotificationService::AllSources());
- if (!GetHistoryService(Profile::EXPLICIT_ACCESS))
+ if (!HistoryServiceFactory::GetForProfile(this, Profile::EXPLICIT_ACCESS))
GetTopSites()->HistoryLoaded();
top_sites_loaded_observer.Wait();
}
@@ -520,14 +524,6 @@
return favicon_service_.get();
}
-HistoryService* TestingProfile::GetHistoryService(ServiceAccessType access) {
- return HistoryServiceFactory::GetForProfileIfExists(this, access);
-}
-
-HistoryService* TestingProfile::GetHistoryServiceWithoutCreating() {
- return HistoryServiceFactory::GetForProfileWithoutCreating(this);
-}
-
net::CookieMonster* TestingProfile::GetCookieMonster() {
if (!GetRequestContext())
return NULL;
@@ -706,10 +702,6 @@
return last_session_exited_cleanly_;
}
-BookmarkModel* TestingProfile::GetBookmarkModel() {
- return BookmarkModelFactory::GetForProfileIfExists(this);
-}
-
bool TestingProfile::IsSameProfile(Profile *p) {
return this == p;
}
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698