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

Side by Side Diff: net/socket/tcp_client_socket_unittest.cc

Issue 3019007: Add a command line flag to change the default number of parallel DNS requests... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address jar's comments Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/socket/ssl_test_util.cc ('k') | net/socket/tcp_pinger_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/tcp_client_socket.h" 5 #include "net/socket/tcp_client_socket.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "net/base/address_list.h" 8 #include "net/base/address_list.h"
9 #include "net/base/host_resolver.h" 9 #include "net/base/host_resolver.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 for (port = kMinPort; port < kMaxPort; port++) { 82 for (port = kMinPort; port < kMaxPort; port++) {
83 sock = ListenSocket::Listen("127.0.0.1", port, this); 83 sock = ListenSocket::Listen("127.0.0.1", port, this);
84 if (sock) 84 if (sock)
85 break; 85 break;
86 } 86 }
87 ASSERT_TRUE(sock != NULL); 87 ASSERT_TRUE(sock != NULL);
88 listen_sock_ = sock; 88 listen_sock_ = sock;
89 listen_port_ = port; 89 listen_port_ = port;
90 90
91 AddressList addr; 91 AddressList addr;
92 scoped_refptr<HostResolver> resolver(CreateSystemHostResolver()); 92 scoped_refptr<HostResolver> resolver(
93 CreateSystemHostResolver(HostResolver::kDefaultParallelism));
93 HostResolver::RequestInfo info("localhost", listen_port_); 94 HostResolver::RequestInfo info("localhost", listen_port_);
94 int rv = resolver->Resolve(info, &addr, NULL, NULL, BoundNetLog()); 95 int rv = resolver->Resolve(info, &addr, NULL, NULL, BoundNetLog());
95 CHECK_EQ(rv, OK); 96 CHECK_EQ(rv, OK);
96 sock_.reset(new TCPClientSocket(addr, &net_log_)); 97 sock_.reset(new TCPClientSocket(addr, &net_log_));
97 } 98 }
98 99
99 TEST_F(TCPClientSocketTest, Connect) { 100 TEST_F(TCPClientSocketTest, Connect) {
100 TestCompletionCallback callback; 101 TestCompletionCallback callback;
101 EXPECT_FALSE(sock_->IsConnected()); 102 EXPECT_FALSE(sock_->IsConnected());
102 103
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 // Close the server socket, so there will at least be a 0-byte read. 339 // Close the server socket, so there will at least be a 0-byte read.
339 CloseServerSocket(); 340 CloseServerSocket();
340 341
341 rv = callback.WaitForResult(); 342 rv = callback.WaitForResult();
342 EXPECT_GE(rv, 0); 343 EXPECT_GE(rv, 0);
343 } 344 }
344 345
345 } // namespace 346 } // namespace
346 347
347 } // namespace net 348 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_test_util.cc ('k') | net/socket/tcp_pinger_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698