| OLD | NEW |
| 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/test/test_server.h" | 5 #include "net/test/test_server.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "net/base/test_completion_callback.h" | 32 #include "net/base/test_completion_callback.h" |
| 33 #include "net/base/test_root_certs.h" | 33 #include "net/base/test_root_certs.h" |
| 34 #include "net/socket/tcp_client_socket.h" | 34 #include "net/socket/tcp_client_socket.h" |
| 35 #include "net/test/python_utils.h" | 35 #include "net/test/python_utils.h" |
| 36 #include "testing/platform_test.h" | 36 #include "testing/platform_test.h" |
| 37 | 37 |
| 38 namespace net { | 38 namespace net { |
| 39 | 39 |
| 40 namespace { | 40 namespace { |
| 41 | 41 |
| 42 // Number of connection attempts for tests. | |
| 43 const int kServerConnectionAttempts = 10; | |
| 44 | |
| 45 // Connection timeout in milliseconds for tests. | |
| 46 const int kServerConnectionTimeoutMs = 1000; | |
| 47 | |
| 48 std::string GetHostname(TestServer::Type type, | 42 std::string GetHostname(TestServer::Type type, |
| 49 const TestServer::HTTPSOptions& options) { | 43 const TestServer::HTTPSOptions& options) { |
| 50 if (type == TestServer::TYPE_HTTPS && | 44 if (type == TestServer::TYPE_HTTPS && |
| 51 options.server_certificate == | 45 options.server_certificate == |
| 52 TestServer::HTTPSOptions::CERT_MISMATCHED_NAME) { | 46 TestServer::HTTPSOptions::CERT_MISMATCHED_NAME) { |
| 53 // Return a different hostname string that resolves to the same hostname. | 47 // Return a different hostname string that resolves to the same hostname. |
| 54 return "localhost"; | 48 return "localhost"; |
| 55 } | 49 } |
| 56 | 50 |
| 57 return "127.0.0.1"; | 51 return "127.0.0.1"; |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_AES256) | 402 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_AES256) |
| 409 command_line->AppendArg(kBulkCipherSwitch + "=aes256"); | 403 command_line->AppendArg(kBulkCipherSwitch + "=aes256"); |
| 410 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_3DES) | 404 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_3DES) |
| 411 command_line->AppendArg(kBulkCipherSwitch + "=3des"); | 405 command_line->AppendArg(kBulkCipherSwitch + "=3des"); |
| 412 } | 406 } |
| 413 | 407 |
| 414 return true; | 408 return true; |
| 415 } | 409 } |
| 416 | 410 |
| 417 } // namespace net | 411 } // namespace net |
| OLD | NEW |