summaryrefslogtreecommitdiffstats
path: root/net/test
diff options
context:
space:
mode:
authorerikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-28 01:54:30 +0000
committererikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-28 01:54:30 +0000
commit2bc448e6e1d0570d866df1e3c9fdfe626bd6e7ec (patch)
tree22b3a3a51385742afa3b5882f32dc7abb1652051 /net/test
parent3cb22660c043eb2a512e0cbd1e0447d9ecaa85fa (diff)
downloadchromium_src-2bc448e6e1d0570d866df1e3c9fdfe626bd6e7ec.zip
chromium_src-2bc448e6e1d0570d866df1e3c9fdfe626bd6e7ec.tar.gz
chromium_src-2bc448e6e1d0570d866df1e3c9fdfe626bd6e7ec.tar.bz2
Remove old TestServer constructor.
BUG=114369 TEST=everything still compiles and passes Review URL: http://codereview.chromium.org/9431002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123859 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/test')
-rw-r--r--net/test/test_server.cc32
-rw-r--r--net/test/test_server.h9
2 files changed, 10 insertions, 31 deletions
diff --git a/net/test/test_server.cc b/net/test/test_server.cc
index 6e65cca..f38abfa 100644
--- a/net/test/test_server.cc
+++ b/net/test/test_server.cc
@@ -37,22 +37,6 @@
namespace net {
-namespace {
-
-std::string GetHostname(TestServer::Type type,
- const TestServer::HTTPSOptions& options) {
- if (type == TestServer::TYPE_HTTPS &&
- options.server_certificate ==
- TestServer::HTTPSOptions::CERT_MISMATCHED_NAME) {
- // Return a different hostname string that resolves to the same hostname.
- return "localhost";
- }
-
- return "127.0.0.1";
-}
-
-} // namespace
-
TestServer::HTTPSOptions::HTTPSOptions()
: server_certificate(CERT_OK),
request_client_certificate(false),
@@ -83,13 +67,6 @@ FilePath TestServer::HTTPSOptions::GetCertificateFile() const {
const char* TestServer::kLocalhost = "127.0.0.1";
-TestServer::TestServer(Type type, const FilePath& document_root)
- : type_(type),
- started_(false),
- log_to_console_(false) {
- Init("127.0.0.1", document_root);
-}
-
TestServer::TestServer(Type type,
const std::string& host,
const FilePath& document_root)
@@ -105,7 +82,14 @@ TestServer::TestServer(const HTTPSOptions& https_options,
type_(TYPE_HTTPS),
started_(false),
log_to_console_(false) {
- Init(GetHostname(TYPE_HTTPS, https_options), document_root);
+ const char* host = "127.0.0.1";
+ if (https_options_.server_certificate ==
+ TestServer::HTTPSOptions::CERT_MISMATCHED_NAME) {
+ // Use a different hostname string that resolves to the same address.
+ host = "localhost";
+ }
+
+ Init(host, document_root);
}
TestServer::~TestServer() {
diff --git a/net/test/test_server.h b/net/test/test_server.h
index e1310bc..6e5eb60 100644
--- a/net/test/test_server.h
+++ b/net/test/test_server.h
@@ -113,13 +113,8 @@ class TestServer {
// Pass as the 'host' parameter during construction to server on 127.0.0.1
static const char* kLocalhost;
- // Initialize a TestServer listening on 127.0.0.1.
- TestServer(Type type, const FilePath& document_root);
-
- // Initialize a TestServer listening on a specific host (IP or hostname).
- TestServer(Type type,
- const std::string& host,
- const FilePath& document_root);
+ // Initialize a TestServer listening on the specified host (IP or hostname).
+ TestServer(Type type, const std::string& host, const FilePath& document_root);
// Initialize a HTTPS TestServer with a specific set of HTTPSOptions.
TestServer(const HTTPSOptions& https_options,