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

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

Issue 2289143003: [Sync] Convert DTCs to be not RefCounted and NonThreadSafe. (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 <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 ProfileSyncService::StartBehavior start_behavior) { 90 ProfileSyncService::StartBehavior start_behavior) {
91 component_factory_ = profile_sync_service_bundle_.component_factory(); 91 component_factory_ = profile_sync_service_bundle_.component_factory();
92 browser_sync::ProfileSyncServiceBundle::SyncClientBuilder builder( 92 browser_sync::ProfileSyncServiceBundle::SyncClientBuilder builder(
93 &profile_sync_service_bundle_); 93 &profile_sync_service_bundle_);
94 ProfileSyncService::InitParams init_params = 94 ProfileSyncService::InitParams init_params =
95 profile_sync_service_bundle_.CreateBasicInitParams(start_behavior, 95 profile_sync_service_bundle_.CreateBasicInitParams(start_behavior,
96 builder.Build()); 96 builder.Build());
97 97
98 sync_service_.reset(new ProfileSyncService(std::move(init_params))); 98 sync_service_.reset(new ProfileSyncService(std::move(init_params)));
99 sync_service_->RegisterDataTypeController( 99 sync_service_->RegisterDataTypeController(
100 new sync_driver::FakeDataTypeController(syncer::BOOKMARKS)); 100 base::MakeUnique<sync_driver::FakeDataTypeController>(
101 syncer::BOOKMARKS));
101 sync_service_->AddObserver(&observer_); 102 sync_service_->AddObserver(&observer_);
102 } 103 }
103 104
104 void IssueTestTokens(const std::string& account_id) { 105 void IssueTestTokens(const std::string& account_id) {
105 profile_sync_service_bundle_.auth_service()->UpdateCredentials( 106 profile_sync_service_bundle_.auth_service()->UpdateCredentials(
106 account_id, "oauth2_login_token"); 107 account_id, "oauth2_login_token");
107 } 108 }
108 109
109 void SetError(DataTypeManager::ConfigureResult* result) { 110 void SetError(DataTypeManager::ConfigureResult* result) {
110 sync_driver::DataTypeStatusTable::TypeErrorMap errors; 111 sync_driver::DataTypeStatusTable::TypeErrorMap errors;
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 pref_service()->ClearPref(sync_driver::prefs::kSyncFirstSetupComplete); 477 pref_service()->ClearPref(sync_driver::prefs::kSyncFirstSetupComplete);
477 478
478 EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber()); 479 EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber());
479 sync_service_->Initialize(); 480 sync_service_->Initialize();
480 481
481 auto sync_blocker = sync_service_->GetSetupInProgressHandle(); 482 auto sync_blocker = sync_service_->GetSetupInProgressHandle();
482 IssueTestTokens(account_id); 483 IssueTestTokens(account_id);
483 sync_blocker.reset(); 484 sync_blocker.reset();
484 EXPECT_FALSE(sync_service_->IsSyncActive()); 485 EXPECT_FALSE(sync_service_->IsSyncActive());
485 } 486 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698