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

Side by Side Diff: components/browser_sync/browser/profile_sync_components_factory_impl.cc

Issue 2328393002: [Sync] Add a sanity integration test for USS. (Closed)
Patch Set: Rebase. Created 4 years, 3 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 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 "components/browser_sync/browser/profile_sync_components_factory_impl.h " 5 #include "components/browser_sync/browser/profile_sync_components_factory_impl.h "
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // disabled. 254 // disabled.
255 if (!disabled_types.Has(syncer::PASSWORDS)) { 255 if (!disabled_types.Has(syncer::PASSWORDS)) {
256 sync_service->RegisterDataTypeController( 256 sync_service->RegisterDataTypeController(
257 base::MakeUnique<PasswordDataTypeController>( 257 base::MakeUnique<PasswordDataTypeController>(
258 error_callback, sync_client_, 258 error_callback, sync_client_,
259 sync_client_->GetPasswordStateChangedCallback(), password_store_)); 259 sync_client_->GetPasswordStateChangedCallback(), password_store_));
260 } 260 }
261 261
262 if (!disabled_types.Has(syncer::PREFERENCES) && 262 if (!disabled_types.Has(syncer::PREFERENCES) &&
263 base::FeatureList::IsEnabled(kSyncPreferencesFeature)) { 263 base::FeatureList::IsEnabled(kSyncPreferencesFeature)) {
264 sync_service->RegisterDataTypeController( 264 if (!override_prefs_controller_to_uss_for_test_) {
265 base::MakeUnique<UIDataTypeController>(syncer::PREFERENCES, 265 sync_service->RegisterDataTypeController(
266 error_callback, sync_client_)); 266 base::MakeUnique<UIDataTypeController>(syncer::PREFERENCES,
267 error_callback, sync_client_));
268 } else {
269 sync_service->RegisterDataTypeController(
270 base::MakeUnique<UIModelTypeController>(
271 syncer::PREFERENCES, error_callback, sync_client_));
272 }
267 } 273 }
268 274
269 if (!disabled_types.Has(syncer::PRIORITY_PREFERENCES)) { 275 if (!disabled_types.Has(syncer::PRIORITY_PREFERENCES)) {
270 sync_service->RegisterDataTypeController( 276 sync_service->RegisterDataTypeController(
271 base::MakeUnique<UIDataTypeController>(syncer::PRIORITY_PREFERENCES, 277 base::MakeUnique<UIDataTypeController>(syncer::PRIORITY_PREFERENCES,
272 error_callback, sync_client_)); 278 error_callback, sync_client_));
273 } 279 }
274 280
275 // Article sync is disabled by default. Register only if explicitly enabled. 281 // Article sync is disabled by default. Register only if explicitly enabled.
276 if (dom_distiller::IsEnableSyncArticlesSet()) { 282 if (dom_distiller::IsEnableSyncArticlesSet()) {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 const bool kExpectMobileBookmarksFolder = false; 412 const bool kExpectMobileBookmarksFolder = false;
407 #endif 413 #endif
408 BookmarkModelAssociator* model_associator = new BookmarkModelAssociator( 414 BookmarkModelAssociator* model_associator = new BookmarkModelAssociator(
409 bookmark_model, sync_service->GetSyncClient(), user_share, 415 bookmark_model, sync_service->GetSyncClient(), user_share,
410 error_handler->Copy(), kExpectMobileBookmarksFolder); 416 error_handler->Copy(), kExpectMobileBookmarksFolder);
411 BookmarkChangeProcessor* change_processor = 417 BookmarkChangeProcessor* change_processor =
412 new BookmarkChangeProcessor(sync_service->GetSyncClient(), 418 new BookmarkChangeProcessor(sync_service->GetSyncClient(),
413 model_associator, std::move(error_handler)); 419 model_associator, std::move(error_handler));
414 return SyncComponents(model_associator, change_processor); 420 return SyncComponents(model_associator, change_processor);
415 } 421 }
422
423 // static
424 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) {
425 override_prefs_controller_to_uss_for_test_ = use_uss;
426 }
427
428 bool ProfileSyncComponentsFactoryImpl::
429 override_prefs_controller_to_uss_for_test_ = false;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698