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

Side by Side Diff: chrome/browser/sync/profile_sync_service_unittest.cc

Issue 1422773004: [sync] Abstract most ProfileSyncService //chrome deps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pss_chrome_signin_deps
Patch Set: Response to review 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/run_loop.h" 11 #include "base/run_loop.h"
12 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "base/thread_task_runner_handle.h" 15 #include "base/thread_task_runner_handle.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "chrome/browser/invalidation/fake_invalidation_service.h" 17 #include "chrome/browser/invalidation/fake_invalidation_service.h"
18 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" 18 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h"
19 #include "chrome/browser/signin/account_tracker_service_factory.h" 19 #include "chrome/browser/signin/account_tracker_service_factory.h"
20 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" 20 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h"
21 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 21 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
22 #include "chrome/browser/signin/signin_manager_factory.h" 22 #include "chrome/browser/signin/signin_manager_factory.h"
23 #include "chrome/browser/sync/chrome_sync_client.h" 23 #include "chrome/browser/sync/chrome_sync_client.h"
24 #include "chrome/browser/sync/glue/sync_backend_host_mock.h" 24 #include "chrome/browser/sync/glue/sync_backend_host_mock.h"
25 #include "chrome/browser/sync/profile_sync_service.h" 25 #include "chrome/browser/sync/profile_sync_service.h"
26 #include "chrome/browser/sync/profile_sync_test_util.h" 26 #include "chrome/browser/sync/profile_sync_test_util.h"
27 #include "chrome/common/channel_info.h"
27 #include "chrome/common/chrome_switches.h" 28 #include "chrome/common/chrome_switches.h"
28 #include "chrome/common/pref_names.h" 29 #include "chrome/common/pref_names.h"
29 #include "chrome/grit/generated_resources.h" 30 #include "chrome/grit/generated_resources.h"
30 #include "chrome/test/base/testing_browser_process.h" 31 #include "chrome/test/base/testing_browser_process.h"
31 #include "chrome/test/base/testing_profile.h" 32 #include "chrome/test/base/testing_profile.h"
32 #include "chrome/test/base/testing_profile_manager.h" 33 #include "chrome/test/base/testing_profile_manager.h"
33 #include "components/invalidation/impl/profile_invalidation_provider.h" 34 #include "components/invalidation/impl/profile_invalidation_provider.h"
34 #include "components/invalidation/public/invalidation_service.h" 35 #include "components/invalidation/public/invalidation_service.h"
35 #include "components/signin/core/browser/account_tracker_service.h" 36 #include "components/signin/core/browser/account_tracker_service.h"
36 #include "components/signin/core/browser/fake_profile_oauth2_token_service.h" 37 #include "components/signin/core/browser/fake_profile_oauth2_token_service.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 scoped_ptr<SyncApiComponentFactoryMock> components_factory( 303 scoped_ptr<SyncApiComponentFactoryMock> components_factory(
303 new SyncApiComponentFactoryMock()); 304 new SyncApiComponentFactoryMock());
304 components_factory_ = components_factory.get(); 305 components_factory_ = components_factory.get();
305 scoped_ptr<ChromeSyncClient> sync_client(new TestChromeSyncClient( 306 scoped_ptr<ChromeSyncClient> sync_client(new TestChromeSyncClient(
306 profile_, components_factory.Pass(), 307 profile_, components_factory.Pass(),
307 base::Bind(&ProfileSyncServiceTest::ClearBrowsingDataCallback, 308 base::Bind(&ProfileSyncServiceTest::ClearBrowsingDataCallback,
308 base::Unretained(this)))); 309 base::Unretained(this))));
309 service_.reset(new ProfileSyncService( 310 service_.reset(new ProfileSyncService(
310 sync_client.Pass(), profile_, 311 sync_client.Pass(), profile_,
311 make_scoped_ptr(new SigninManagerWrapper(signin)), oauth2_token_service, 312 make_scoped_ptr(new SigninManagerWrapper(signin)), oauth2_token_service,
312 behavior, base::Bind(&EmptyNetworkTimeUpdate))); 313 behavior, base::Bind(&EmptyNetworkTimeUpdate), profile_->GetPath(),
314 profile_->GetRequestContext(), profile_->GetDebugName(),
315 chrome::GetChannel(),
316 content::BrowserThread::GetMessageLoopProxyForThread(
317 content::BrowserThread::DB),
318 content::BrowserThread::GetMessageLoopProxyForThread(
319 content::BrowserThread::FILE),
320 content::BrowserThread::GetBlockingPool()));
313 service_->RegisterDataTypeController( 321 service_->RegisterDataTypeController(
314 new sync_driver::FakeDataTypeController(syncer::BOOKMARKS)); 322 new sync_driver::FakeDataTypeController(syncer::BOOKMARKS));
315 } 323 }
316 324
317 #if defined(OS_WIN) || defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(OS_C HROMEOS)) 325 #if defined(OS_WIN) || defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(OS_C HROMEOS))
318 void CreateServiceWithoutSignIn() { 326 void CreateServiceWithoutSignIn() {
319 CreateService(browser_sync::AUTO_START); 327 CreateService(browser_sync::AUTO_START);
320 SigninManagerFactory::GetForProfile(profile())->SignOut( 328 SigninManagerFactory::GetForProfile(profile())->SignOut(
321 signin_metrics::SIGNOUT_TEST); 329 signin_metrics::SIGNOUT_TEST);
322 } 330 }
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 InitializeForNthSync(); 1023 InitializeForNthSync();
1016 1024
1017 syncer::SyncProtocolError client_cmd; 1025 syncer::SyncProtocolError client_cmd;
1018 client_cmd.action = syncer::RESET_LOCAL_SYNC_DATA; 1026 client_cmd.action = syncer::RESET_LOCAL_SYNC_DATA;
1019 service()->OnActionableError(client_cmd); 1027 service()->OnActionableError(client_cmd);
1020 EXPECT_EQ(ProfileSyncService::SYNC, service()->backend_mode()); 1028 EXPECT_EQ(ProfileSyncService::SYNC, service()->backend_mode());
1021 } 1029 }
1022 1030
1023 } // namespace 1031 } // namespace
1024 } // namespace browser_sync 1032 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698