OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |