Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: net/base/address_list_unittest.cc

Issue 9369045: [net] HostResolverImpl + DnsTransaction + DnsConfigService = Asynchronous DNS ready for experiments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Denitted. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/address_list.cc ('k') | net/base/host_resolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/address_list_unittest.cc
diff --git a/net/base/address_list_unittest.cc b/net/base/address_list_unittest.cc
index 3dda87a785af7a675be71d6a5afd1339839f2e15..7eda7df94f7588247a907089044b2b8d9ff23a7e 100644
--- a/net/base/address_list_unittest.cc
+++ b/net/base/address_list_unittest.cc
@@ -216,7 +216,7 @@ TEST(AddressListTest, IPLiteralConstructor) {
const struct addrinfo* good_ai = expected_list.head();
IPAddressNumber ip_number;
- ParseIPLiteralToNumber(tests[i].ip_address, &ip_number);
+ ASSERT_TRUE(ParseIPLiteralToNumber(tests[i].ip_address, &ip_number));
AddressList test_list = AddressList::CreateFromIPAddressWithCname(
ip_number, 80, true);
const struct addrinfo* test_ai = test_list.head();
@@ -305,18 +305,21 @@ TEST(AddressListTest, CreateFromIPAddressList) {
sizeof(struct in_addr),
},
};
- const uint16 kPort = 80;
+ const std::string kCanonicalName = "canonical.example.com";
// Construct a list of ip addresses.
IPAddressList ip_list;
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
IPAddressNumber ip_number;
- ParseIPLiteralToNumber(tests[i].ip_address, &ip_number);
+ ASSERT_TRUE(ParseIPLiteralToNumber(tests[i].ip_address, &ip_number));
ip_list.push_back(ip_number);
}
- AddressList test_list = AddressList::CreateFromIPAddressList(ip_list, kPort);
- EXPECT_EQ(kPort, test_list.GetPort());
+ AddressList test_list = AddressList::CreateFromIPAddressList(ip_list,
+ kCanonicalName);
+ std::string canonical_name;
+ EXPECT_TRUE(test_list.GetCanonicalName(&canonical_name));
+ EXPECT_EQ(kCanonicalName, canonical_name);
// Make sure that CreateFromIPAddressList has created an addrinfo
// chain of exactly the same length as the |tests| with correct content.
« no previous file with comments | « net/base/address_list.cc ('k') | net/base/host_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698