OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/base/network_interfaces.h" | 5 #include "net/base/network_interfaces.h" |
6 | 6 |
| 7 #include <string> |
| 8 |
7 #include <ostream> | 9 #include <ostream> |
8 #include <string> | |
9 #include <unordered_set> | |
10 | 10 |
11 // TODO(eroman): Remove unneeeded headers. | 11 // TODO(eroman): Remove unneeeded headers. |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/format_macros.h" | 13 #include "base/format_macros.h" |
14 #include "base/scoped_native_library.h" | 14 #include "base/scoped_native_library.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
19 #include "base/sys_byteorder.h" | 19 #include "base/sys_byteorder.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 222 |
223 char* GetInterfaceNameVM(int interface_index, char* ifname) { | 223 char* GetInterfaceNameVM(int interface_index, char* ifname) { |
224 return CopyInterfaceName(ifname_vm, arraysize(ifname_vm), ifname); | 224 return CopyInterfaceName(ifname_vm, arraysize(ifname_vm), ifname); |
225 } | 225 } |
226 | 226 |
227 TEST(NetworkInterfacesTest, GetNetworkListTrimming) { | 227 TEST(NetworkInterfacesTest, GetNetworkListTrimming) { |
228 IPAddress ipv6_local_address(kIPv6LocalAddr); | 228 IPAddress ipv6_local_address(kIPv6LocalAddr); |
229 IPAddress ipv6_address(kIPv6Addr); | 229 IPAddress ipv6_address(kIPv6Addr); |
230 | 230 |
231 NetworkInterfaceList results; | 231 NetworkInterfaceList results; |
232 std::unordered_set<int> online_links; | 232 ::base::hash_set<int> online_links; |
233 internal::AddressTrackerLinux::AddressMap address_map; | 233 internal::AddressTrackerLinux::AddressMap address_map; |
234 | 234 |
235 // Interface 1 is offline. | 235 // Interface 1 is offline. |
236 struct ifaddrmsg msg = { | 236 struct ifaddrmsg msg = { |
237 AF_INET6, | 237 AF_INET6, |
238 1, /* prefix length */ | 238 1, /* prefix length */ |
239 IFA_F_TEMPORARY, /* address flags */ | 239 IFA_F_TEMPORARY, /* address flags */ |
240 0, /* link scope */ | 240 0, /* link scope */ |
241 1 /* link index */ | 241 1 /* link index */ |
242 }; | 242 }; |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 // We can't check the result of GetHostName() directly, since the result | 742 // We can't check the result of GetHostName() directly, since the result |
743 // will differ across machines. Our goal here is to simply exercise the | 743 // will differ across machines. Our goal here is to simply exercise the |
744 // code path, and check that things "look about right". | 744 // code path, and check that things "look about right". |
745 std::string hostname = GetHostName(); | 745 std::string hostname = GetHostName(); |
746 EXPECT_FALSE(hostname.empty()); | 746 EXPECT_FALSE(hostname.empty()); |
747 } | 747 } |
748 | 748 |
749 } // namespace | 749 } // namespace |
750 | 750 |
751 } // namespace net | 751 } // namespace net |
OLD | NEW |