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

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

Issue 7011044: Add a command line option to turn off retry attempts to resolve host (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/proxy/proxy_script_fetcher_impl_unittest.cc ('k') | net/test/test_server.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 if (sock) 112 if (sock)
113 break; 113 break;
114 } 114 }
115 ASSERT_TRUE(sock != NULL); 115 ASSERT_TRUE(sock != NULL);
116 listen_sock_ = sock; 116 listen_sock_ = sock;
117 listen_port_ = port; 117 listen_port_ = port;
118 118
119 AddressList addr; 119 AddressList addr;
120 scoped_ptr<HostResolver> resolver( 120 scoped_ptr<HostResolver> resolver(
121 CreateSystemHostResolver(HostResolver::kDefaultParallelism, 121 CreateSystemHostResolver(HostResolver::kDefaultParallelism,
122 HostResolver::kDefaultRetryAttempts,
122 NULL)); 123 NULL));
123 HostResolver::RequestInfo info(HostPortPair("localhost", listen_port_)); 124 HostResolver::RequestInfo info(HostPortPair("localhost", listen_port_));
124 int rv = resolver->Resolve(info, &addr, NULL, NULL, BoundNetLog()); 125 int rv = resolver->Resolve(info, &addr, NULL, NULL, BoundNetLog());
125 CHECK_EQ(rv, OK); 126 CHECK_EQ(rv, OK);
126 sock_.reset( 127 sock_.reset(
127 socket_factory_->CreateTransportClientSocket(addr, 128 socket_factory_->CreateTransportClientSocket(addr,
128 &net_log_, 129 &net_log_,
129 NetLog::Source())); 130 NetLog::Source()));
130 } 131 }
131 132
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 // Close the server socket, so there will at least be a 0-byte read. 428 // Close the server socket, so there will at least be a 0-byte read.
428 CloseServerSocket(); 429 CloseServerSocket();
429 430
430 rv = callback.WaitForResult(); 431 rv = callback.WaitForResult();
431 EXPECT_GE(rv, 0); 432 EXPECT_GE(rv, 0);
432 } 433 }
433 434
434 } // namespace 435 } // namespace
435 436
436 } // namespace net 437 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_script_fetcher_impl_unittest.cc ('k') | net/test/test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698