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

Unified Diff: net/base/address_list_unittest.cc

Issue 149511: Refactorings surrounding HostResolver:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Merge in socks5_client_socket_unittest.cc Created 11 years, 5 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 | « chrome/test/unit/chrome_test_suite.h ('k') | net/base/host_resolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/address_list_unittest.cc
===================================================================
--- net/base/address_list_unittest.cc (revision 20760)
+++ net/base/address_list_unittest.cc (working copy)
@@ -4,15 +4,8 @@
#include "net/base/address_list.h"
-#if defined(OS_WIN)
-#include <ws2tcpip.h>
-#include <wspiapi.h> // Needed for Win2k compat.
-#elif defined(OS_POSIX)
-#include <netdb.h>
-#include <sys/socket.h>
-#endif
-
#include "base/string_util.h"
+#include "net/base/host_resolver_proc.h"
#include "net/base/net_util.h"
#if defined(OS_WIN)
#include "net/base/winsock_init.h"
@@ -26,17 +19,9 @@
#if defined(OS_WIN)
net::EnsureWinsockInit();
#endif
- std::string portstr = IntToString(port);
-
- struct addrinfo* result = NULL;
- struct addrinfo hints = {0};
- hints.ai_family = AF_UNSPEC;
- hints.ai_flags = AI_NUMERICHOST;
- hints.ai_socktype = SOCK_STREAM;
-
- int err = getaddrinfo("192.168.1.1", portstr.c_str(), &hints, &result);
- EXPECT_EQ(0, err);
- addrlist->Adopt(result);
+ int rv = SystemHostResolverProc("192.168.1.1", addrlist);
+ EXPECT_EQ(0, rv);
+ addrlist->SetPort(port);
}
TEST(AddressListTest, GetPort) {
« no previous file with comments | « chrome/test/unit/chrome_test_suite.h ('k') | net/base/host_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698