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

Unified Diff: chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc

Issue 242693003: Introduce BookmarkClient interface to abstract embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation of unit tests Created 6 years, 8 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
Index: chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
index 73babc4d99342c109231b4ec97e8977dfe394464..868c9010524637fa90f124c367fd01bfc625915b 100644
--- a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
@@ -56,14 +56,19 @@ class HistoryMock : public HistoryService {
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;
}
KeyedService* BuildBookmarkModelWithoutLoading(
content::BrowserContext* profile) {
- return new BookmarkModel(static_cast<Profile*>(profile));
+ return new ChromeBookmarkClient(static_cast<Profile*>(profile));
}
KeyedService* BuildHistoryService(content::BrowserContext* profile) {
@@ -100,14 +105,14 @@ class SyncBookmarkDataTypeControllerTest : public testing::Test {
void CreateBookmarkModel(BookmarkLoadPolicy bookmark_load_policy) {
if (bookmark_load_policy == LOAD_MODEL) {
- bookmark_model_ = static_cast<BookmarkModel*>(
+ bookmark_model_ = static_cast<ChromeBookmarkClient*>(
BookmarkModelFactory::GetInstance()->SetTestingFactoryAndUse(
- &profile_, BuildBookmarkModel));
+ &profile_, BuildBookmarkModel))->model();
test::WaitForBookmarkModelToLoad(bookmark_model_);
} else {
- bookmark_model_ = static_cast<BookmarkModel*>(
+ bookmark_model_ = static_cast<ChromeBookmarkClient*>(
BookmarkModelFactory::GetInstance()->SetTestingFactoryAndUse(
- &profile_, BuildBookmarkModelWithoutLoading));
+ &profile_, BuildBookmarkModelWithoutLoading))->model();
}
}
@@ -180,7 +185,11 @@ TEST_F(SyncBookmarkDataTypeControllerTest, StartBookmarkModelNotReady) {
base::Unretained(&model_load_callback_)));
EXPECT_EQ(DataTypeController::MODEL_STARTING, bookmark_dtc_->state());
- bookmark_model_->Load(profile_.GetIOTaskRunner());
+ bookmark_model_->Load(profile_.GetPrefs(),
+ profile_.GetPath(),
+ profile_.GetIOTaskRunner(),
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::UI));
test::WaitForBookmarkModelToLoad(bookmark_model_);
EXPECT_EQ(DataTypeController::MODEL_LOADED, bookmark_dtc_->state());

Powered by Google App Engine
This is Rietveld 408576698