| Index: net/test/test_server.cc
|
| diff --git a/net/test/test_server.cc b/net/test/test_server.cc
|
| index 397b0bc975a0c348647fa3cde430dd2b6d57fc9a..99fe06a8d583c52d1947a6d1f823dd51ecb98ef0 100644
|
| --- a/net/test/test_server.cc
|
| +++ b/net/test/test_server.cc
|
| @@ -69,6 +69,19 @@ FilePath TestServer::HTTPSOptions::GetCertificateFile() const {
|
| return FilePath();
|
| }
|
|
|
| +std::string TestServer::HTTPSOptions::GetSpecialCertificateString() const {
|
| + switch (server_certificate) {
|
| + case OCSP_OK:
|
| + return "__ocsp_ok__";
|
| + case OCSP_REVOKED:
|
| + return "__ocsp_revoked__";
|
| + case OCSP_INVALID:
|
| + return "__ocsp_invalid__";
|
| + default:
|
| + return "";
|
| + }
|
| +}
|
| +
|
| const char TestServer::kLocalhost[] = "127.0.0.1";
|
| const char TestServer::kGDataAuthToken[] = "testtoken";
|
|
|
| @@ -383,16 +396,21 @@ bool TestServer::AddCommandLineArguments(CommandLine* command_line) const {
|
| // --auth-token will be used in tests for chrome/browser/chromeos/gdata.
|
| command_line->AppendArg(std::string("--auth-token=") + kGDataAuthToken);
|
| } else if (type_ == TYPE_HTTPS) {
|
| - FilePath certificate_path(certificates_dir_);
|
| - certificate_path = certificate_path.Append(
|
| - https_options_.GetCertificateFile());
|
| - if (!file_util::PathExists(certificate_path)) {
|
| - LOG(ERROR) << "Certificate path " << certificate_path.value()
|
| - << " doesn't exist. Can't launch https server.";
|
| - return false;
|
| + std::string cert_option = https_options_.GetSpecialCertificateString();
|
| + if (!cert_option.empty()) {
|
| + command_line->AppendArg("--https=" + cert_option);
|
| + } else {
|
| + FilePath certificate_path(certificates_dir_);
|
| + certificate_path = certificate_path.Append(
|
| + https_options_.GetCertificateFile());
|
| + if (!file_util::PathExists(certificate_path)) {
|
| + LOG(ERROR) << "Certificate path " << certificate_path.value()
|
| + << " doesn't exist. Can't launch https server.";
|
| + return false;
|
| + }
|
| + command_line->AppendArgNative(FILE_PATH_LITERAL("--https=") +
|
| + certificate_path.value());
|
| }
|
| - command_line->AppendArgNative(FILE_PATH_LITERAL("--https=") +
|
| - certificate_path.value());
|
|
|
| if (https_options_.request_client_certificate)
|
| command_line->AppendArg("--ssl-client-auth");
|
|
|