| OLD | NEW |
| 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/proximity_auth/proximity_auth_system.h" | 5 #include "components/proximity_auth/proximity_auth_system.h" |
| 6 #include "components/proximity_auth/remote_device.h" | 6 #include "components/proximity_auth/remote_device.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 namespace proximity_auth { | 9 namespace proximity_auth { |
| 10 | 10 |
| 11 TEST(ProximityAuthSystemTest, GetRemoteDevices) { | 11 TEST(ProximityAuthSystemTest, GetRemoteDevices) { |
| 12 RemoteDevice device1 = { "device 1" }; | 12 RemoteDevice device1 = {"device 1"}; |
| 13 RemoteDevice device2 = { "device 2" }; | 13 RemoteDevice device2 = {"device 2"}; |
| 14 | 14 |
| 15 std::vector<RemoteDevice> device_list; | 15 std::vector<RemoteDevice> device_list; |
| 16 device_list.push_back(device1); | 16 device_list.push_back(device1); |
| 17 device_list.push_back(device2); | 17 device_list.push_back(device2); |
| 18 | 18 |
| 19 ProximityAuthSystem system(device_list); | 19 ProximityAuthSystem system(device_list); |
| 20 | 20 |
| 21 const std::vector<RemoteDevice>& returned_list = system.GetRemoteDevices(); | 21 const std::vector<RemoteDevice>& returned_list = system.GetRemoteDevices(); |
| 22 ASSERT_EQ(2u, returned_list.size()); | 22 ASSERT_EQ(2u, returned_list.size()); |
| 23 EXPECT_EQ(device1.name, returned_list[0].name); | 23 EXPECT_EQ(device1.name, returned_list[0].name); |
| 24 EXPECT_EQ(device2.name, returned_list[1].name); | 24 EXPECT_EQ(device2.name, returned_list[1].name); |
| 25 } | 25 } |
| 26 | 26 |
| 27 } // namespace proximity_auth | 27 } // namespace proximity_auth |
| OLD | NEW |