| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 const char kTestServerShardFlag[] = "test-server-shard"; | 41 const char kTestServerShardFlag[] = "test-server-shard"; |
| 42 | 42 |
| 43 int GetPortBase(net::TestServer::Type type) { | 43 int GetPortBase(net::TestServer::Type type) { |
| 44 switch (type) { | 44 switch (type) { |
| 45 case net::TestServer::TYPE_FTP: | 45 case net::TestServer::TYPE_FTP: |
| 46 return 3117; | 46 return 3117; |
| 47 case net::TestServer::TYPE_HTTP: | 47 case net::TestServer::TYPE_HTTP: |
| 48 return 1337; | 48 return 1337; |
| 49 case net::TestServer::TYPE_HTTPS: | 49 case net::TestServer::TYPE_HTTPS: |
| 50 return 9443; |
| 50 case net::TestServer::TYPE_HTTPS_CLIENT_AUTH: | 51 case net::TestServer::TYPE_HTTPS_CLIENT_AUTH: |
| 52 return 9543; |
| 51 case net::TestServer::TYPE_HTTPS_EXPIRED_CERTIFICATE: | 53 case net::TestServer::TYPE_HTTPS_EXPIRED_CERTIFICATE: |
| 52 return 9443; | 54 // TODO(phajdan.jr): Some tests rely on this hardcoded value. |
| 55 // Some uses of this are actually in .html/.js files. |
| 56 return 9666; |
| 53 case net::TestServer::TYPE_HTTPS_MISMATCHED_HOSTNAME: | 57 case net::TestServer::TYPE_HTTPS_MISMATCHED_HOSTNAME: |
| 54 return 9666; | 58 return 9643; |
| 55 default: | 59 default: |
| 56 NOTREACHED(); | 60 NOTREACHED(); |
| 57 } | 61 } |
| 58 return -1; | 62 return -1; |
| 59 } | 63 } |
| 60 | 64 |
| 61 int GetPort(net::TestServer::Type type) { | 65 int GetPort(net::TestServer::Type type) { |
| 62 int port = GetPortBase(type); | 66 int port = GetPortBase(type); |
| 63 if (CommandLine::ForCurrentProcess()->HasSwitch(kTestServerShardFlag)) { | 67 if (CommandLine::ForCurrentProcess()->HasSwitch(kTestServerShardFlag)) { |
| 64 std::string shard_str(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 68 std::string shard_str(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 return certificates_dir_.AppendASCII("ok_cert.pem"); | 298 return certificates_dir_.AppendASCII("ok_cert.pem"); |
| 295 case TYPE_HTTPS_EXPIRED_CERTIFICATE: | 299 case TYPE_HTTPS_EXPIRED_CERTIFICATE: |
| 296 return certificates_dir_.AppendASCII("expired_cert.pem"); | 300 return certificates_dir_.AppendASCII("expired_cert.pem"); |
| 297 default: | 301 default: |
| 298 NOTREACHED(); | 302 NOTREACHED(); |
| 299 } | 303 } |
| 300 return FilePath(); | 304 return FilePath(); |
| 301 } | 305 } |
| 302 | 306 |
| 303 } // namespace net | 307 } // namespace net |
| OLD | NEW |