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/net_util.h" | 5 #include "net/base/net_util.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <ostream> | 9 #include <ostream> |
10 | 10 |
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1525 { false, "::192.9.5.5" }, | 1525 { false, "::192.9.5.5" }, |
1526 { false, "FEED::BEEF" }, | 1526 { false, "FEED::BEEF" }, |
1527 { false, "FEC0:ba98:7654:3210:FEDC:BA98:7654:3210" }, | 1527 { false, "FEC0:ba98:7654:3210:FEDC:BA98:7654:3210" }, |
1528 // 'internal'/non-IANA assigned domains. | 1528 // 'internal'/non-IANA assigned domains. |
1529 { false, "intranet" }, | 1529 { false, "intranet" }, |
1530 { false, "intranet." }, | 1530 { false, "intranet." }, |
1531 { false, "intranet.example" }, | 1531 { false, "intranet.example" }, |
1532 { false, "host.intranet.example" }, | 1532 { false, "host.intranet.example" }, |
1533 // gTLDs under discussion, but not yet assigned. | 1533 // gTLDs under discussion, but not yet assigned. |
1534 { false, "intranet.corp" }, | 1534 { false, "intranet.corp" }, |
1535 { false, "example.tech" }, | |
1536 { false, "intranet.internal" }, | 1535 { false, "intranet.internal" }, |
1537 // Invalid host names are treated as unique - but expected to be | 1536 // Invalid host names are treated as unique - but expected to be |
1538 // filtered out before then. | 1537 // filtered out before then. |
1539 { true, "junk)(£)$*!@~#" }, | 1538 { true, "junk)(£)$*!@~#" }, |
1540 { true, "w$w.example.com" }, | 1539 { true, "w$w.example.com" }, |
1541 { true, "nocolonsallowed:example" }, | 1540 { true, "nocolonsallowed:example" }, |
1542 { true, "[::4.5.6.9]" }, | 1541 { true, "[::4.5.6.9]" }, |
1543 }; | 1542 }; |
1544 | 1543 |
1545 class NetUtilNonUniqueNameTest | 1544 class NetUtilNonUniqueNameTest |
(...skipping 13 matching lines...) Expand all Loading... |
1559 TEST_P(NetUtilNonUniqueNameTest, IsHostnameNonUnique) { | 1558 TEST_P(NetUtilNonUniqueNameTest, IsHostnameNonUnique) { |
1560 const NonUniqueNameTestData& test_data = GetParam(); | 1559 const NonUniqueNameTestData& test_data = GetParam(); |
1561 | 1560 |
1562 EXPECT_EQ(test_data.is_unique, IsUnique(test_data.hostname)); | 1561 EXPECT_EQ(test_data.is_unique, IsUnique(test_data.hostname)); |
1563 } | 1562 } |
1564 | 1563 |
1565 INSTANTIATE_TEST_CASE_P(, NetUtilNonUniqueNameTest, | 1564 INSTANTIATE_TEST_CASE_P(, NetUtilNonUniqueNameTest, |
1566 testing::ValuesIn(kNonUniqueNameTestData)); | 1565 testing::ValuesIn(kNonUniqueNameTestData)); |
1567 | 1566 |
1568 } // namespace net | 1567 } // namespace net |
OLD | NEW |