| Index: net/test/spawned_test_server/base_test_server.cc
|
| diff --git a/net/test/spawned_test_server/base_test_server.cc b/net/test/spawned_test_server/base_test_server.cc
|
| index db64e1f04e205c7c9f4106871b3cc6e88d771143..69aa57155e98e29ec0bd6ce942055d3c21ad1551 100644
|
| --- a/net/test/spawned_test_server/base_test_server.cc
|
| +++ b/net/test/spawned_test_server/base_test_server.cc
|
| @@ -300,6 +300,24 @@ bool BaseTestServer::GetFilePathWithReplacements(
|
| return true;
|
| }
|
|
|
| +bool BaseTestServer::LoadTestRootCert() const {
|
| + TestRootCerts* root_certs = TestRootCerts::GetInstance();
|
| + if (!root_certs)
|
| + return false;
|
| +
|
| + // Should always use absolute path to load the root certificate.
|
| + base::FilePath root_certificate_path = certificates_dir_;
|
| + if (!certificates_dir_.IsAbsolute()) {
|
| + base::FilePath src_dir;
|
| + if (!PathService::Get(base::DIR_SOURCE_ROOT, &src_dir))
|
| + return false;
|
| + root_certificate_path = src_dir.Append(certificates_dir_);
|
| + }
|
| +
|
| + return root_certs->AddFromFile(
|
| + root_certificate_path.AppendASCII("root_ca_cert.pem"));
|
| +}
|
| +
|
| void BaseTestServer::Init(const std::string& host) {
|
| host_port_pair_ = HostPortPair(host, 0);
|
|
|
| @@ -342,24 +360,6 @@ bool BaseTestServer::ParseServerData(const std::string& server_data) {
|
| return true;
|
| }
|
|
|
| -bool BaseTestServer::LoadTestRootCert() const {
|
| - TestRootCerts* root_certs = TestRootCerts::GetInstance();
|
| - if (!root_certs)
|
| - return false;
|
| -
|
| - // Should always use absolute path to load the root certificate.
|
| - base::FilePath root_certificate_path = certificates_dir_;
|
| - if (!certificates_dir_.IsAbsolute()) {
|
| - base::FilePath src_dir;
|
| - if (!PathService::Get(base::DIR_SOURCE_ROOT, &src_dir))
|
| - return false;
|
| - root_certificate_path = src_dir.Append(certificates_dir_);
|
| - }
|
| -
|
| - return root_certs->AddFromFile(
|
| - root_certificate_path.AppendASCII("root_ca_cert.pem"));
|
| -}
|
| -
|
| bool BaseTestServer::SetupWhenServerStarted() {
|
| DCHECK(host_port_pair_.port());
|
|
|
|
|