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/base/ssl_test_util.h" | 8 #include "net/base/ssl_test_util.h" |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 net::HostResolver resolver; | 249 net::HostResolver resolver; |
250 int rv = resolver.Resolve(host_name, port, &addr, NULL, NULL); | 250 net::HostResolver::RequestInfo info(host_name, port); |
| 251 int rv = resolver.Resolve(info, &addr, NULL, NULL); |
251 if (rv != net::OK) | 252 if (rv != net::OK) |
252 return false; | 253 return false; |
253 | 254 |
254 net::TCPPinger pinger(addr); | 255 net::TCPPinger pinger(addr); |
255 rv = pinger.Ping(); | 256 rv = pinger.Ping(); |
256 return rv == net::OK; | 257 return rv == net::OK; |
257 } | 258 } |
258 | 259 |
259 bool TestServerLauncher::WaitToFinish(int timeout_ms) { | 260 bool TestServerLauncher::WaitToFinish(int timeout_ms) { |
260 if (!process_handle_) | 261 if (!process_handle_) |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 "certificate to your trusted roots for this test to work. " | 357 "certificate to your trusted roots for this test to work. " |
357 "For more info visit:\n" | 358 "For more info visit:\n" |
358 "http://dev.chromium.org/developers/testing\n"; | 359 "http://dev.chromium.org/developers/testing\n"; |
359 return false; | 360 return false; |
360 } | 361 } |
361 #endif | 362 #endif |
362 return true; | 363 return true; |
363 } | 364 } |
364 | 365 |
365 } // namespace net | 366 } // namespace net |
OLD | NEW |