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

Unified Diff: net/dns/host_resolver_impl_unittest.cc

Issue 938093003: Always treat .localhost as loopback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move constants, add a test case, style fix Created 5 years, 9 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
« net/base/net_util.cc ('K') | « net/dns/host_resolver_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/host_resolver_impl_unittest.cc
diff --git a/net/dns/host_resolver_impl_unittest.cc b/net/dns/host_resolver_impl_unittest.cc
index 7a46a1c4dc4e3cfc1998858a5fb8bc75bd9b0fe7..5b123947a4c76452fd1b25696eb56b2214b1d6ed 100644
--- a/net/dns/host_resolver_impl_unittest.cc
+++ b/net/dns/host_resolver_impl_unittest.cc
@@ -550,6 +550,17 @@ TEST_F(HostResolverImplTest, AsynchronousLookup) {
EXPECT_EQ("just.testing", proc_->GetCaptureList()[0].hostname);
}
+TEST_F(HostResolverImplTest, LocalhostLookup) {
+ proc_->SignalMultiple(1u);
+ Request* req = CreateRequest("foo.localhost", 80);
+ EXPECT_EQ(ERR_IO_PENDING, req->Resolve());
+ EXPECT_EQ(OK, req->WaitForResult());
+
+ EXPECT_TRUE(req->HasOneAddress("127.0.0.1", 80));
+
+ EXPECT_EQ("localhost.", proc_->GetCaptureList()[0].hostname);
+}
+
TEST_F(HostResolverImplTest, EmptyListMeansNameNotResolved) {
proc_->AddRuleForAllFamilies("just.testing", "");
proc_->SignalMultiple(1u);
« net/base/net_util.cc ('K') | « net/dns/host_resolver_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698