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

Side by Side Diff: net/socket/ssl_test_util.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/socket/ssl_client_socket_unittest.cc ('k') | net/socket/tcp_client_socket_pool_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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <string> 5 #include <string>
6 #include <algorithm> 6 #include <algorithm>
7 7
8 #include "net/socket/ssl_test_util.h" 8 #include "net/socket/ssl_test_util.h"
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 } 239 }
240 240
241 LOG(INFO) << "Started on port " << port_str; 241 LOG(INFO) << "Started on port " << port_str;
242 return true; 242 return true;
243 } 243 }
244 244
245 bool TestServerLauncher::WaitToStart(const std::string& host_name, int port) { 245 bool TestServerLauncher::WaitToStart(const std::string& host_name, int port) {
246 // Verify that the webserver is actually started. 246 // Verify that the webserver is actually started.
247 // Otherwise tests can fail if they run faster than Python can start. 247 // Otherwise tests can fail if they run faster than Python can start.
248 net::AddressList addr; 248 net::AddressList addr;
249 scoped_refptr<net::HostResolver> resolver(new net::HostResolver); 249 scoped_refptr<net::HostResolver> resolver(net::CreateSystemHostResolver());
250 net::HostResolver::RequestInfo info(host_name, port); 250 net::HostResolver::RequestInfo info(host_name, port);
251 int rv = resolver->Resolve(info, &addr, NULL, NULL); 251 int rv = resolver->Resolve(info, &addr, NULL, NULL);
252 if (rv != net::OK) 252 if (rv != net::OK)
253 return false; 253 return false;
254 254
255 net::TCPPinger pinger(addr); 255 net::TCPPinger pinger(addr);
256 rv = pinger.Ping(); 256 rv = pinger.Ping();
257 return rv == net::OK; 257 return rv == net::OK;
258 } 258 }
259 259
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 "certificate to your trusted roots for this test to work. " 357 "certificate to your trusted roots for this test to work. "
358 "For more info visit:\n" 358 "For more info visit:\n"
359 "http://dev.chromium.org/developers/testing\n"; 359 "http://dev.chromium.org/developers/testing\n";
360 return false; 360 return false;
361 } 361 }
362 #endif 362 #endif
363 return true; 363 return true;
364 } 364 }
365 365
366 } // namespace net 366 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_unittest.cc ('k') | net/socket/tcp_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698