diff options
Diffstat (limited to 'chrome/test/testing_profile.cc')
-rw-r--r-- | chrome/test/testing_profile.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc index c6238c0..f412d90 100644 --- a/chrome/test/testing_profile.cc +++ b/chrome/test/testing_profile.cc @@ -12,6 +12,7 @@ #include "chrome/browser/net/url_request_context_getter.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/common/chrome_constants.h" +#include "chrome/common/notification_service.h" #include "net/url_request/url_request_context.h" #include "webkit/database/database_tracker.h" @@ -133,11 +134,22 @@ TestingProfile::TestingProfile(int count) } TestingProfile::~TestingProfile() { + NotificationService::current()->Notify( + NotificationType::PROFILE_DESTROYED, + Source<Profile>(this), + NotificationService::NoDetails()); DestroyHistoryService(); + // FaviconService depends on HistoryServce so destroying it later. + DestroyFaviconService(); DestroyWebDataService(); file_util::Delete(path_, true); } +void TestingProfile::CreateFaviconService() { + favicon_service_ = NULL; + favicon_service_ = new FaviconService(this); +} + void TestingProfile::CreateHistoryService(bool delete_file, bool no_db) { if (history_service_.get()) history_service_->Cleanup(); @@ -153,6 +165,12 @@ void TestingProfile::CreateHistoryService(bool delete_file, bool no_db) { history_service_->Init(GetPath(), bookmark_bar_model_.get(), no_db); } +void TestingProfile::DestroyFaviconService() { + if (!favicon_service_.get()) + return; + favicon_service_ = NULL; +} + void TestingProfile::DestroyHistoryService() { if (!history_service_.get()) return; |