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

Unified Diff: net/dns/host_resolver_impl_unittest.cc

Issue 1768643002: Remove an incorrect DCHECK() when calling HostResolverImpl::Resolve() with an IP literal and HOST_RE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/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 3d30dbeb95f266d6d1626caeb41c907e86b12d1c..1406014eedea37341477a7cf1f2cc2bcd855b5c8 100644
--- a/net/dns/host_resolver_impl_unittest.cc
+++ b/net/dns/host_resolver_impl_unittest.cc
@@ -673,6 +673,22 @@ TEST_F(HostResolverImplTest, LocalhostIPV4IPV6Lookup) {
EXPECT_TRUE(req5->HasOneAddress("::1", 80));
}
+TEST_F(HostResolverImplTest, ResolveIPLiteralWithHostResolverSystemOnly) {
+ const char kIpLiteral[] = "178.78.32.1";
+ // Add a mapping to tell if the resolver proc was called (if it was called,
+ // then the result will be the remapped value. Otherwise it will be the IP
+ // literal).
+ proc_->AddRuleForAllFamilies(kIpLiteral, "183.45.32.1");
+
+ HostResolver::RequestInfo info_bypass(HostPortPair(kIpLiteral, 80));
+ info_bypass.set_host_resolver_flags(HOST_RESOLVER_SYSTEM_ONLY);
+
+ Request* req = CreateRequest(info_bypass, MEDIUM);
+ EXPECT_EQ(OK, req->Resolve());
+
+ EXPECT_TRUE(req->HasAddress(kIpLiteral, 80));
+}
+
TEST_F(HostResolverImplTest, EmptyListMeansNameNotResolved) {
proc_->AddRuleForAllFamilies("just.testing", "");
proc_->SignalMultiple(1u);
« no previous file with comments | « net/dns/host_resolver_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698