| Index: chrome/test/testing_profile.cc
|
| diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc
|
| index aa36a1f796286bd0f264fc34919fffd3682172bb..28d5d916969985134a666de6a8fbffb0d8c6918b 100644
|
| --- a/chrome/test/testing_profile.cc
|
| +++ b/chrome/test/testing_profile.cc
|
| @@ -30,6 +30,7 @@
|
| #include "chrome/browser/prefs/browser_prefs.h"
|
| #include "chrome/browser/prefs/testing_pref_store.h"
|
| #include "chrome/browser/prerender/prerender_manager.h"
|
| +#include "chrome/browser/profiles/profile_dependency_manager.h"
|
| #include "chrome/browser/search_engines/template_url_fetcher.h"
|
| #include "chrome/browser/search_engines/template_url_model.h"
|
| #include "chrome/browser/sessions/session_service.h"
|
| @@ -145,7 +146,8 @@ TestingProfile::TestingProfile()
|
| : start_time_(Time::Now()),
|
| testing_prefs_(NULL),
|
| incognito_(false),
|
| - last_session_exited_cleanly_(true) {
|
| + last_session_exited_cleanly_(true),
|
| + profile_dependency_manager_(ProfileDependencyManager::GetInstance()) {
|
| if (!temp_dir_.CreateUniqueTempDir()) {
|
| LOG(ERROR) << "Failed to create unique temporary directory.";
|
|
|
| @@ -174,8 +176,11 @@ TestingProfile::TestingProfile()
|
| TestingProfile::~TestingProfile() {
|
| NotificationService::current()->Notify(
|
| NotificationType::PROFILE_DESTROYED,
|
| - Source<Profile>(this),
|
| + Source<Profile>(static_cast<Profile*>(this)),
|
| NotificationService::NoDetails());
|
| +
|
| + profile_dependency_manager_->DestroyProfileServices(this);
|
| +
|
| DestroyTopSites();
|
| DestroyHistoryService();
|
| // FaviconService depends on HistoryServce so destroying it later.
|
| @@ -356,6 +361,11 @@ TestingPrefService* TestingProfile::GetTestingPrefService() {
|
| return testing_prefs_;
|
| }
|
|
|
| +void TestingProfile::SetProfileDependencyManager(
|
| + ProfileDependencyManager* manager) {
|
| + profile_dependency_manager_ = manager;
|
| +}
|
| +
|
| ProfileId TestingProfile::GetRuntimeId() {
|
| return reinterpret_cast<ProfileId>(this);
|
| }
|
|
|