Index: components/proximity_auth/proximity_auth_system_unittest.cc |
diff --git a/components/proximity_auth/proximity_auth_system_unittest.cc b/components/proximity_auth/proximity_auth_system_unittest.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f1f6e62213e0aa51d0293451ebb7d420a90f7e4e |
--- /dev/null |
+++ b/components/proximity_auth/proximity_auth_system_unittest.cc |
@@ -0,0 +1,26 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "components/proximity_auth/proximity_auth_system.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
+ |
+namespace proximity_auth { |
+ |
+TEST(ProximityAuthSystemTest, GetRemoteDevices) { |
+ RemoteDevice device1 = { "device 1" }; |
+ RemoteDevice device2 = { "device 2" }; |
+ |
+ RemoteDeviceList device_list; |
+ device_list.push_back(device1); |
+ device_list.push_back(device2); |
+ |
+ ProximityAuthSystem system(device_list); |
+ |
+ const RemoteDeviceList& returned_list = system.GetRemoteDevices(); |
+ EXPECT_EQ(2u, returned_list.size()); |
Ilya Sherman
2014/08/27 03:18:33
nit: This should be an ASSERT_EQ, as otherwise the
Tim Song
2014/08/27 19:40:05
Done.
|
+ EXPECT_EQ(device1.name, returned_list[0].name); |
+ EXPECT_EQ(device2.name, returned_list[1].name); |
+} |
+ |
+} // namespace proximity_auth |