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

Unified Diff: net/dns/host_resolver_impl_unittest.cc

Issue 14760008: HostResolverImpl will return ERR_NAME_NOT_RESOLVED instead of Ok if address list is empty (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed Empty List check from OnProcTaskComplete. Created 7 years, 7 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 a26213152621ae37745e76990f9c5873e9f437fc..2693cca9da151b416c9f00e04752892a66eab291 100644
--- a/net/dns/host_resolver_impl_unittest.cc
+++ b/net/dns/host_resolver_impl_unittest.cc
@@ -531,6 +531,17 @@ TEST_F(HostResolverImplTest, AsynchronousLookup) {
EXPECT_EQ("just.testing", proc_->GetCaptureList()[0].hostname);
}
+TEST_F(HostResolverImplTest, EmptyListMeansNameNotResolved) {
+ proc_->AddRuleForAllFamilies("just.testing", "");
+ proc_->SignalMultiple(1u);
+
+ Request* req = CreateRequest("just.testing", 80);
+ EXPECT_EQ(ERR_IO_PENDING, req->Resolve());
+ EXPECT_EQ(ERR_NAME_NOT_RESOLVED, req->WaitForResult());
+ EXPECT_EQ(0u, req->NumberOfAddresses());
+ EXPECT_EQ("just.testing", proc_->GetCaptureList()[0].hostname);
+}
+
TEST_F(HostResolverImplTest, FailedAsynchronousLookup) {
proc_->AddRuleForAllFamilies(std::string(),
"0.0.0.0"); // Default to failures.
« 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