Chromium Code Reviews| Index: net/test/test_server.cc |
| diff --git a/net/test/test_server.cc b/net/test/test_server.cc |
| index 4b426eb4e9d28fc5a825f5d3f04b2a986190d8f3..e88448aab60a1a1a03f629912f0172722de28de5 100644 |
| --- a/net/test/test_server.cc |
| +++ b/net/test/test_server.cc |
| @@ -22,9 +22,9 @@ |
| #include "base/string_number_conversions.h" |
| #include "base/utf_string_conversions.h" |
| #include "googleurl/src/gurl.h" |
| -#include "net/base/cert_test_util.h" |
| #include "net/base/host_port_pair.h" |
| #include "net/base/host_resolver.h" |
| +#include "net/base/temporary_root_certs.h" |
| #include "net/base/test_completion_callback.h" |
| #include "net/socket/tcp_client_socket.h" |
| #include "net/test/python_utils.h" |
| @@ -107,10 +107,6 @@ std::string GetHostname(TestServer::Type type, |
| } // namespace |
| -#if defined(OS_MACOSX) |
| -void SetMacTestCertificate(X509Certificate* cert); |
| -#endif |
| - |
| TestServer::HTTPSOptions::HTTPSOptions() |
| : server_certificate(CERT_OK), |
| request_client_certificate(false), |
| @@ -149,9 +145,8 @@ TestServer::TestServer(const HTTPSOptions& https_options, |
| } |
| TestServer::~TestServer() { |
| -#if defined(OS_MACOSX) |
| - SetMacTestCertificate(NULL); |
| -#endif |
| + TemporaryRootCerts* root_certs = TemporaryRootCerts::GetInstance(); |
| + root_certs->RemoveFromFile(GetRootCertificatePath()); |
| Stop(); |
| } |
| @@ -175,8 +170,6 @@ bool TestServer::Start() { |
| if (type_ == TYPE_HTTPS) { |
| if (!LoadTestRootCert()) |
| return false; |
| - if (!CheckCATrusted()) |
| - return false; |
| } |
| // Get path to python server script |
| @@ -320,27 +313,9 @@ FilePath TestServer::GetRootCertificatePath() { |
| } |
| bool TestServer::LoadTestRootCert() { |
| -#if defined(USE_NSS) |
| - if (cert_) |
| - return true; |
| - |
| // TODO(dkegel): figure out how to get this to only happen once? |
|
bulach
2010/11/09 16:21:09
afaict, this is no longer necessary as TemporaryRo
|
| - |
| - // This currently leaks a little memory. |
| - // TODO(dkegel): fix the leak and remove the entry in |
| - // tools/valgrind/memcheck/suppressions.txt |
| - ANNOTATE_SCOPED_MEMORY_LEAK; // Tell heap checker about the leak. |
| - cert_ = LoadTemporaryRootCert(GetRootCertificatePath()); |
| - return (cert_ != NULL); |
| -#elif defined(OS_MACOSX) |
| - X509Certificate* cert = LoadTemporaryRootCert(GetRootCertificatePath()); |
| - if (!cert) |
| - return false; |
| - SetMacTestCertificate(cert); |
| - return true; |
| -#else |
| - return true; |
| -#endif |
| + TemporaryRootCerts* root_certs = TemporaryRootCerts::GetInstance(); |
| + return root_certs->AddFromFile(GetRootCertificatePath()); |
| } |
| bool TestServer::AddCommandLineArguments(CommandLine* command_line) const { |