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

Side by Side Diff: components/sync/device_info/device_info_service_unittest.cc

Issue 2256733004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/device_info/device_info_service.h" 5 #include "components/sync/device_info/device_info_service.h"
6 6
7 #include <map> 7 #include <map>
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 OnSyncStarting(); 356 OnSyncStarting();
357 ASSERT_EQ(0u, service()->GetAllDeviceInfo().size()); 357 ASSERT_EQ(0u, service()->GetAllDeviceInfo().size());
358 base::RunLoop().RunUntilIdle(); 358 base::RunLoop().RunUntilIdle();
359 ScopedVector<DeviceInfo> all_device_info(service()->GetAllDeviceInfo()); 359 ScopedVector<DeviceInfo> all_device_info(service()->GetAllDeviceInfo());
360 ASSERT_EQ(1u, all_device_info.size()); 360 ASSERT_EQ(1u, all_device_info.size());
361 ASSERT_TRUE( 361 ASSERT_TRUE(
362 local_device()->GetLocalDeviceInfo()->Equals(*all_device_info[0])); 362 local_device()->GetLocalDeviceInfo()->Equals(*all_device_info[0]));
363 } 363 }
364 364
365 TEST_F(DeviceInfoServiceTest, LocalProviderSubscription) { 365 TEST_F(DeviceInfoServiceTest, LocalProviderSubscription) {
366 set_local_device(base::WrapUnique(new LocalDeviceInfoProviderMock())); 366 set_local_device(base::MakeUnique<LocalDeviceInfoProviderMock>());
367 InitializeAndPumpAndStart(); 367 InitializeAndPumpAndStart();
368 368
369 ASSERT_EQ(0u, service()->GetAllDeviceInfo().size()); 369 ASSERT_EQ(0u, service()->GetAllDeviceInfo().size());
370 local_device()->Initialize(CreateDeviceInfo()); 370 local_device()->Initialize(CreateDeviceInfo());
371 base::RunLoop().RunUntilIdle(); 371 base::RunLoop().RunUntilIdle();
372 372
373 ScopedVector<DeviceInfo> all_device_info(service()->GetAllDeviceInfo()); 373 ScopedVector<DeviceInfo> all_device_info(service()->GetAllDeviceInfo());
374 ASSERT_EQ(1u, all_device_info.size()); 374 ASSERT_EQ(1u, all_device_info.size());
375 ASSERT_TRUE( 375 ASSERT_TRUE(
376 local_device()->GetLocalDeviceInfo()->Equals(*all_device_info[0])); 376 local_device()->GetLocalDeviceInfo()->Equals(*all_device_info[0]));
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 specifics.set_cache_guid("non-local"); 771 specifics.set_cache_guid("non-local");
772 PushBackEntityChangeAdd(specifics, &change_list); 772 PushBackEntityChangeAdd(specifics, &change_list);
773 service()->ApplySyncChanges(service()->CreateMetadataChangeList(), 773 service()->ApplySyncChanges(service()->CreateMetadataChangeList(),
774 change_list); 774 change_list);
775 EXPECT_EQ(1, service()->CountActiveDevices()); 775 EXPECT_EQ(1, service()->CountActiveDevices());
776 } 776 }
777 777
778 } // namespace 778 } // namespace
779 779
780 } // namespace sync_driver_v2 780 } // namespace sync_driver_v2
OLDNEW
« no previous file with comments | « components/sync/device_info/device_info_service.cc ('k') | components/sync/driver/fake_sync_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698