Undisable HostResolverImplTest.EmptyHost, by making empty host fail to resolve.
Review URL: http://codereview.chromium.org/164546
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23576 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/base/host_resolver_proc.cc b/net/base/host_resolver_proc.cc
index 585a33e..8951646 100644
--- a/net/base/host_resolver_proc.cc
+++ b/net/base/host_resolver_proc.cc
@@ -125,6 +125,12 @@
#endif // defined(OS_LINUX)
int SystemHostResolverProc(const std::string& host, AddressList* addrlist) {
+ // The result of |getaddrinfo| for empty hosts is inconsistent across systems.
+ // On Windows it gives the default interface's address, whereas on Linux it
+ // gives an error. We will make it fail on all platforms for consistency.
+ if (host.empty())
+ return ERR_NAME_NOT_RESOLVED;
+
struct addrinfo* ai = NULL;
struct addrinfo hints = {0};
hints.ai_family = AF_UNSPEC;