OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/media/router/discovery/discovery_network_list.h" | |
6 | |
7 #include <algorithm> | |
8 #include <iterator> | |
9 #include <set> | |
10 | |
11 #include "testing/gtest/include/gtest/gtest.h" | |
12 | |
13 TEST(DiscoveryNetworkList, GetDiscoveryNetworkIdList) { | |
14 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
| |
15 for (const auto& network_id : network_ids) { | |
16 EXPECT_LT(0UL, network_id.interface_name.size()); | |
17 EXPECT_LT(0UL, network_id.network_id.size()); | |
18 } | |
19 | |
20 auto interface_name_set = std::set<std::string>{}; | |
21 std::transform(begin(network_ids), end(network_ids), | |
22 std::insert_iterator<std::set<std::string>>{ | |
23 interface_name_set, end(interface_name_set)}, | |
24 [](const DiscoveryNetworkId& network_id) { | |
25 return network_id.interface_name; | |
26 }); | |
27 | |
28 EXPECT_EQ(interface_name_set.size(), network_ids.size()); | |
29 } | |
OLD | NEW |