| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 #include "net/base/net_util.h" | 10 #include "net/base/net_util.h" |
| (...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 0x98, 0x76, 0x54, 0x32, 0x10}, | 862 0x98, 0x76, 0x54, 0x32, 0x10}, |
| 863 "fedc:ba98:7654:3210:fedc:ba98:7654:3210"}, | 863 "fedc:ba98:7654:3210:fedc:ba98:7654:3210"}, |
| 864 }; | 864 }; |
| 865 | 865 |
| 866 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { | 866 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { |
| 867 const addrinfo* ai = GetIPv6Address(tests[i].addr); | 867 const addrinfo* ai = GetIPv6Address(tests[i].addr); |
| 868 std::string result = net::NetAddressToString(ai); | 868 std::string result = net::NetAddressToString(ai); |
| 869 EXPECT_EQ(std::string(tests[i].result), result); | 869 EXPECT_EQ(std::string(tests[i].result), result); |
| 870 } | 870 } |
| 871 } | 871 } |
| 872 |
| 873 TEST(NetUtilTest, GetMyHostName) { |
| 874 // We can't check the result of GetMyHostName() directly, since the result |
| 875 // will differ across machines. Our goal here is to simply exercise the |
| 876 // code path, and check that things "look about right". |
| 877 std::string my_hostname = net::GetMyHostName(); |
| 878 EXPECT_FALSE(my_hostname.empty()); |
| 879 } |
| OLD | NEW |