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

Unified Diff: net/test/spawned_test_server/base_test_server.cc

Issue 1058003004: Forget SSL error exceptions when good certs seen for regular requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Tests related to unsafe resources w/user exceptions Created 5 years, 8 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
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());

Powered by Google App Engine
This is Rietveld 408576698