OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |