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

Unified Diff: components/proximity_auth/proximity_auth_system_unittest.cc

Issue 505373004: Introduce proximity_auth component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move unit test to component_unittests Created 6 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 side-by-side diff with in-line comments
Download patch
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..f8d1be1cd95c9c895456f45e62ac1709867f1060
--- /dev/null
+++ b/components/proximity_auth/proximity_auth_system_unittest.cc
@@ -0,0 +1,27 @@
+// 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 "components/proximity_auth/remote_device.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace proximity_auth {
+
+TEST(ProximityAuthSystemTest, GetRemoteDevices) {
+ RemoteDevice device1 = { "device 1" };
+ RemoteDevice device2 = { "device 2" };
+
+ std::vector<RemoteDevice> device_list;
+ device_list.push_back(device1);
+ device_list.push_back(device2);
+
+ ProximityAuthSystem system(device_list);
+
+ const std::vector<RemoteDevice>& returned_list = system.GetRemoteDevices();
+ ASSERT_EQ(2u, returned_list.size());
+ EXPECT_EQ(device1.name, returned_list[0].name);
+ EXPECT_EQ(device2.name, returned_list[1].name);
+}
+
+} // namespace proximity_auth

Powered by Google App Engine
This is Rietveld 408576698