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

Unified Diff: chrome/browser/media/router/discovery/discovery_network_list_unittest.cc

Issue 2750453002: Add DiscoveryNetworkMonitor implementation (Closed)
Patch Set: Respond to mfoltz' and imcheng's comments Created 3 years, 9 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: chrome/browser/media/router/discovery/discovery_network_list_unittest.cc
diff --git a/chrome/browser/media/router/discovery/discovery_network_list_unittest.cc b/chrome/browser/media/router/discovery/discovery_network_list_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8abd839b68fbca2c222b9249da1b45d3a1d657b6
--- /dev/null
+++ b/chrome/browser/media/router/discovery/discovery_network_list_unittest.cc
@@ -0,0 +1,29 @@
+// Copyright (c) 2017 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 "chrome/browser/media/router/discovery/discovery_network_list.h"
+
+#include <algorithm>
+#include <iterator>
+#include <set>
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(DiscoveryNetworkList, GetDiscoveryNetworkIdList) {
+ auto network_ids = GetDiscoveryNetworkIdList();
mark a. foltz 2017/04/18 20:37:00 It looks like you're not mocking anything out but
btolsch 2017/04/20 04:03:50 I am testing that the interface name and network I
+ for (const auto& network_id : network_ids) {
+ EXPECT_LT(0UL, network_id.interface_name.size());
+ EXPECT_LT(0UL, network_id.network_id.size());
+ }
+
+ auto interface_name_set = std::set<std::string>{};
+ std::transform(begin(network_ids), end(network_ids),
+ std::insert_iterator<std::set<std::string>>{
+ interface_name_set, end(interface_name_set)},
+ [](const DiscoveryNetworkId& network_id) {
+ return network_id.interface_name;
+ });
+
+ EXPECT_EQ(interface_name_set.size(), network_ids.size());
+}

Powered by Google App Engine
This is Rietveld 408576698