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

Side by Side Diff: components/sync/driver/shared_change_processor_unittest.cc

Issue 2422253002: [Sync] Rewriting ".reset(new" pattern to use "= base::MakeUnique" instead. (Closed)
Patch Set: Fixing compile. Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/sync/driver/shared_change_processor.h" 5 #include "components/sync/driver/shared_change_processor.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/ptr_util.h"
12 #include "base/synchronization/waitable_event.h" 13 #include "base/synchronization/waitable_event.h"
13 #include "base/threading/thread.h" 14 #include "base/threading/thread.h"
14 #include "components/sync/base/model_type.h" 15 #include "components/sync/base/model_type.h"
15 #include "components/sync/device_info/local_device_info_provider.h" 16 #include "components/sync/device_info/local_device_info_provider.h"
16 #include "components/sync/driver/fake_sync_client.h" 17 #include "components/sync/driver/fake_sync_client.h"
17 #include "components/sync/driver/generic_change_processor.h" 18 #include "components/sync/driver/generic_change_processor.h"
18 #include "components/sync/driver/generic_change_processor_factory.h" 19 #include "components/sync/driver/generic_change_processor_factory.h"
19 #include "components/sync/driver/sync_api_component_factory.h" 20 #include "components/sync/driver/sync_api_component_factory.h"
20 #include "components/sync/model/attachments/attachment_id.h" 21 #include "components/sync/model/attachments/attachment_id.h"
21 #include "components/sync/model/attachments/attachment_service.h" 22 #include "components/sync/model/attachments/attachment_service.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 base::Unretained(this), base::Unretained(&event)))); 154 base::Unretained(this), base::Unretained(&event))));
154 event.Wait(); 155 event.Wait();
155 return has_attachment_service_; 156 return has_attachment_service_;
156 } 157 }
157 158
158 private: 159 private:
159 // Used by SetUp(). 160 // Used by SetUp().
160 void SetUpDBSyncableService() { 161 void SetUpDBSyncableService() {
161 DCHECK(backend_thread_.task_runner()->BelongsToCurrentThread()); 162 DCHECK(backend_thread_.task_runner()->BelongsToCurrentThread());
162 DCHECK(!db_syncable_service_.get()); 163 DCHECK(!db_syncable_service_.get());
163 db_syncable_service_.reset(new FakeSyncableService()); 164 db_syncable_service_ = base::MakeUnique<FakeSyncableService>();
164 } 165 }
165 166
166 // Used by TearDown(). 167 // Used by TearDown().
167 void TearDownDBSyncableService() { 168 void TearDownDBSyncableService() {
168 DCHECK(backend_thread_.task_runner()->BelongsToCurrentThread()); 169 DCHECK(backend_thread_.task_runner()->BelongsToCurrentThread());
169 DCHECK(db_syncable_service_.get()); 170 DCHECK(db_syncable_service_.get());
170 db_syncable_service_.reset(); 171 db_syncable_service_.reset();
171 } 172 }
172 173
173 void SetAttachmentStoreOnDBThread() { 174 void SetAttachmentStoreOnDBThread() {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 // creates AttachmentService and passes it back to the syncable service. 224 // creates AttachmentService and passes it back to the syncable service.
224 TEST_F(SyncSharedChangeProcessorTest, ConnectWithAttachmentStore) { 225 TEST_F(SyncSharedChangeProcessorTest, ConnectWithAttachmentStore) {
225 SetAttachmentStore(); 226 SetAttachmentStore();
226 Connect(); 227 Connect();
227 EXPECT_TRUE(HasAttachmentService()); 228 EXPECT_TRUE(HasAttachmentService());
228 } 229 }
229 230
230 } // namespace 231 } // namespace
231 232
232 } // namespace syncer 233 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/driver/model_type_controller_unittest.cc ('k') | components/sync/driver/startup_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698