| Index: net/base/net_util_unittest.cc
|
| diff --git a/net/base/net_util_unittest.cc b/net/base/net_util_unittest.cc
|
| index 8f05c2049c2a374d36567612354d389640d960ff..1ce057a1be67a6d202b5fc0be255e03001365827 100644
|
| --- a/net/base/net_util_unittest.cc
|
| +++ b/net/base/net_util_unittest.cc
|
| @@ -2167,6 +2167,34 @@ TEST(NetUtilTest, IPNumberMatchesPrefix) {
|
| }
|
| }
|
|
|
| +TEST(NetUtilTest, IsLocalhost) {
|
| + EXPECT_TRUE(net::IsLocalhost("localhost"));
|
| + EXPECT_TRUE(net::IsLocalhost("localhost.localdomain"));
|
| + EXPECT_TRUE(net::IsLocalhost("localhost6"));
|
| + EXPECT_TRUE(net::IsLocalhost("localhost6.localdomain6"));
|
| + EXPECT_TRUE(net::IsLocalhost("127.0.0.1"));
|
| + EXPECT_TRUE(net::IsLocalhost("127.0.1.0"));
|
| + EXPECT_TRUE(net::IsLocalhost("127.1.0.0"));
|
| + EXPECT_TRUE(net::IsLocalhost("127.0.0.255"));
|
| + EXPECT_TRUE(net::IsLocalhost("127.0.255.0"));
|
| + EXPECT_TRUE(net::IsLocalhost("127.255.0.0"));
|
| + EXPECT_TRUE(net::IsLocalhost("::1"));
|
| + EXPECT_TRUE(net::IsLocalhost("0:0:0:0:0:0:0:1"));
|
| +
|
| + EXPECT_FALSE(net::IsLocalhost("localhostx"));
|
| + EXPECT_FALSE(net::IsLocalhost("foo.localdomain"));
|
| + EXPECT_FALSE(net::IsLocalhost("localhost6x"));
|
| + EXPECT_FALSE(net::IsLocalhost("localhost.localdomain6"));
|
| + EXPECT_FALSE(net::IsLocalhost("localhost6.localdomain"));
|
| + EXPECT_FALSE(net::IsLocalhost("127.0.0.1.1"));
|
| + EXPECT_FALSE(net::IsLocalhost(".127.0.0.255"));
|
| + EXPECT_FALSE(net::IsLocalhost("::2"));
|
| + EXPECT_FALSE(net::IsLocalhost("::1:1"));
|
| + EXPECT_FALSE(net::IsLocalhost("0:0:0:0:1:0:0:1"));
|
| + EXPECT_FALSE(net::IsLocalhost("::1:1"));
|
| + EXPECT_FALSE(net::IsLocalhost("0:0:0:0:0:0:0:0:1"));
|
| +}
|
| +
|
| // Verify GetNetworkList().
|
| TEST(NetUtilTest, GetNetworkList) {
|
| net::NetworkInterfaceList list;
|
|
|