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

Unified Diff: chrome/browser/sync/test_profile_sync_service.cc

Issue 1421003007: [Sync] Componentize ProfileSyncComponentsFactoryImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix sessions api test Created 5 years, 1 month 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/browser/sync/sessions/sessions_sync_manager_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/test_profile_sync_service.cc
diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc
index ea7778bed8ab176e142895cb3392eb8f3af88202..2a724d843eed44cdf8ad7064680b63092491d2a4 100644
--- a/chrome/browser/sync/test_profile_sync_service.cc
+++ b/chrome/browser/sync/test_profile_sync_service.cc
@@ -126,22 +126,24 @@ TestProfileSyncService::TestProfileSyncService(
SigninManagerBase* signin,
ProfileOAuth2TokenService* oauth2_token_service,
browser_sync::ProfileSyncServiceStartBehavior behavior)
- : ProfileSyncService(make_scoped_ptr(new browser_sync::ChromeSyncClient(
- profile,
- make_scoped_ptr(new SyncApiComponentFactoryMock))),
- make_scoped_ptr(new SigninManagerWrapper(signin)),
- oauth2_token_service,
- behavior,
- base::Bind(&EmptyNetworkTimeUpdate),
- profile->GetPath(),
- profile->GetRequestContext(),
- profile->GetDebugName(),
- chrome::GetChannel(),
- content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::DB),
- content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::FILE),
- content::BrowserThread::GetBlockingPool()) {
+ : ProfileSyncService(
+ make_scoped_ptr(new browser_sync::ChromeSyncClient(profile)),
+ make_scoped_ptr(new SigninManagerWrapper(signin)),
+ oauth2_token_service,
+ behavior,
+ base::Bind(&EmptyNetworkTimeUpdate),
+ profile->GetPath(),
+ profile->GetRequestContext(),
+ profile->GetDebugName(),
+ chrome::GetChannel(),
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::DB),
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::FILE),
+ content::BrowserThread::GetBlockingPool()) {
+ static_cast<browser_sync::ChromeSyncClient*>(GetSyncClient())
+ ->SetSyncApiComponentFactoryForTesting(
+ make_scoped_ptr(new SyncApiComponentFactoryMock));
SetSyncSetupCompleted();
}
@@ -169,9 +171,8 @@ TestProfileSyncService* TestProfileSyncService::BuildAutoStartAsyncInit(
SyncApiComponentFactoryMock* components =
sync_service->GetSyncApiComponentFactoryMock();
// TODO(tim): Convert to a fake instead of mock.
- EXPECT_CALL(*components,
- CreateSyncBackendHost(testing::_, testing::_, testing::_,
- testing::_, testing::_))
+ EXPECT_CALL(*components, CreateSyncBackendHost(testing::_, testing::_,
+ testing::_, testing::_))
.WillOnce(
testing::Return(new browser_sync::SyncBackendHostForProfileSyncTest(
profile, sync_service->GetSyncClient(),
« no previous file with comments | « chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698