Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(622)

Unified Diff: net/test/test_server.cc

Issue 9431002: Remove old TestServer constructor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge with trunk. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/test/test_server.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/test_server.cc
diff --git a/net/test/test_server.cc b/net/test/test_server.cc
index 6e65cca6c6c7083c4ee917661c9bd17090bcaa95..f38abfaccd421ad07d0a6cc738ccf8684961a182 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() {
« no previous file with comments | « net/test/test_server.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698