Index: chrome/test/base/testing_profile.cc |
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc |
index 85a7bf77128457812636de3dfa376891b4918ed1..71d0348478f69d84fe2b68394051e7ba3f19ee09 100644 |
--- a/chrome/test/base/testing_profile.cc |
+++ b/chrome/test/base/testing_profile.cc |
@@ -17,6 +17,7 @@ |
#include "chrome/browser/autocomplete/autocomplete_classifier.h" |
#include "chrome/browser/bookmarks/bookmark_model.h" |
#include "chrome/browser/bookmarks/bookmark_model_factory.h" |
+#include "chrome/browser/bookmarks/chrome_bookmark_client.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/content_settings/host_content_settings_map.h" |
@@ -494,9 +495,14 @@ void TestingProfile::DestroyTopSites() { |
static KeyedService* BuildBookmarkModel(content::BrowserContext* context) { |
Profile* profile = static_cast<Profile*>(context); |
- BookmarkModel* bookmark_model = new BookmarkModel(profile); |
- bookmark_model->Load(profile->GetIOTaskRunner()); |
- return bookmark_model; |
+ ChromeBookmarkClient* bookmark_client = new ChromeBookmarkClient(profile); |
+ bookmark_client->model()->Load( |
+ profile->GetPrefs(), |
+ profile->GetPath(), |
+ profile->GetIOTaskRunner(), |
+ content::BrowserThread::GetMessageLoopProxyForThread( |
+ content::BrowserThread::UI)); |
+ return bookmark_client; |
} |
void TestingProfile::CreateBookmarkModel(bool delete_file) { |
@@ -505,13 +511,14 @@ void TestingProfile::CreateBookmarkModel(bool delete_file) { |
base::DeleteFile(path, false); |
} |
// This will create a bookmark model. |
- BookmarkModel* bookmark_service = static_cast<BookmarkModel*>( |
+ ChromeBookmarkClient* bookmark_client = static_cast<ChromeBookmarkClient*>( |
BookmarkModelFactory::GetInstance()->SetTestingFactoryAndUse( |
this, BuildBookmarkModel)); |
HistoryService* history_service = |
HistoryServiceFactory::GetForProfileWithoutCreating(this); |
if (history_service) { |
+ BookmarkService* bookmark_service = bookmark_client->model(); |
history_service->history_backend_->bookmark_service_ = bookmark_service; |
history_service->history_backend_->expirer_.bookmark_service_ = |
bookmark_service; |