| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/ssl_test_util.h" | 5 #include "net/socket/ssl_test_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 return true; | 215 return true; |
| 216 } | 216 } |
| 217 | 217 |
| 218 bool TestServerLauncher::WaitToStart(const std::string& host_name, int port) { | 218 bool TestServerLauncher::WaitToStart(const std::string& host_name, int port) { |
| 219 // Verify that the webserver is actually started. | 219 // Verify that the webserver is actually started. |
| 220 // Otherwise tests can fail if they run faster than Python can start. | 220 // Otherwise tests can fail if they run faster than Python can start. |
| 221 net::AddressList addr; | 221 net::AddressList addr; |
| 222 scoped_refptr<net::HostResolver> resolver( | 222 scoped_refptr<net::HostResolver> resolver( |
| 223 net::CreateSystemHostResolver(NULL)); | 223 net::CreateSystemHostResolver(NULL)); |
| 224 net::HostResolver::RequestInfo info(host_name, port); | 224 net::HostResolver::RequestInfo info(host_name, port); |
| 225 int rv = resolver->Resolve(info, &addr, NULL, NULL, NULL); | 225 int rv = resolver->Resolve(info, &addr, NULL, NULL, BoundNetLog()); |
| 226 if (rv != net::OK) | 226 if (rv != net::OK) |
| 227 return false; | 227 return false; |
| 228 | 228 |
| 229 net::TCPPinger pinger(addr); | 229 net::TCPPinger pinger(addr); |
| 230 rv = pinger.Ping(base::TimeDelta::FromMilliseconds(connection_timeout_), | 230 rv = pinger.Ping(base::TimeDelta::FromMilliseconds(connection_timeout_), |
| 231 connection_attempts_); | 231 connection_attempts_); |
| 232 return rv == net::OK; | 232 return rv == net::OK; |
| 233 } | 233 } |
| 234 | 234 |
| 235 bool TestServerLauncher::WaitToFinish(int timeout_ms) { | 235 bool TestServerLauncher::WaitToFinish(int timeout_ms) { |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 "certificate to your trusted roots for this test to work. " | 340 "certificate to your trusted roots for this test to work. " |
| 341 "For more info visit:\n" | 341 "For more info visit:\n" |
| 342 "http://dev.chromium.org/developers/testing\n"; | 342 "http://dev.chromium.org/developers/testing\n"; |
| 343 return false; | 343 return false; |
| 344 } | 344 } |
| 345 #endif | 345 #endif |
| 346 return true; | 346 return true; |
| 347 } | 347 } |
| 348 | 348 |
| 349 } // namespace net | 349 } // namespace net |
| OLD | NEW |