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

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: Created 7 years, 8 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/dns/host_resolver_impl.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 a26213152621ae37745e76990f9c5873e9f437fc..496bf5df09205671e0a4fef62a0e7f3f097f571b 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, EmptyListIsNotOk) {
+ 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());
szym 2013/05/04 07:46:32 To be true to the test this should be: EXPECT_NE(O
+
+ EXPECT_EQ("just.testing", proc_->GetCaptureList()[0].hostname);
+}
+
TEST_F(HostResolverImplTest, FailedAsynchronousLookup) {
proc_->AddRuleForAllFamilies(std::string(),
"0.0.0.0"); // Default to failures.
« net/dns/host_resolver_impl.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