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

Unified Diff: components/certificate_reporting/error_report_unittest.cc

Issue 2926463002: Fix TransportSecurityState unittests to run in --single-process mode. (Closed)
Patch Set: Fixup model tests Created 3 years, 6 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: components/certificate_reporting/error_report_unittest.cc
diff --git a/components/certificate_reporting/error_report_unittest.cc b/components/certificate_reporting/error_report_unittest.cc
index 18c548ca473749a5490d8761c961dfd71b2aeff0..03667c5b973ed262cbb8d99cb6095a1b4518336a 100644
--- a/components/certificate_reporting/error_report_unittest.cc
+++ b/components/certificate_reporting/error_report_unittest.cc
@@ -41,7 +41,7 @@ namespace {
const char kDummyHostname[] = "dummy.hostname.com";
const char kDummyFailureLog[] = "dummy failure log";
-const char kTestCertFilename[] = "test_mail_google_com.pem";
+const char kTestCertFilename[] = "x509_verify_results.chain.pem";
const net::CertStatus kCertStatus =
net::CERT_STATUS_COMMON_NAME_INVALID | net::CERT_STATUS_REVOKED;
@@ -76,10 +76,17 @@ void GetTestSSLInfo(UnverifiedCertChainStatus unverified_cert_chain_status,
}
std::string GetPEMEncodedChain() {
- base::FilePath cert_path =
- net::GetTestCertsDirectory().AppendASCII(kTestCertFilename);
std::string cert_data;
- EXPECT_TRUE(base::ReadFileToString(cert_path, &cert_data));
+ std::vector<std::string> pem_certs;
+ scoped_refptr<net::X509Certificate> cert =
+ net::ImportCertFromFile(net::GetTestCertsDirectory(), kTestCertFilename);
+ if (!cert || !cert->GetPEMEncodedChain(&pem_certs)) {
+ ADD_FAILURE();
+ return cert_data;
+ }
+ for (const auto& cert : pem_certs) {
+ cert_data += cert;
+ }
return cert_data;
}
« no previous file with comments | « chrome/common/net/x509_certificate_model_unittest.cc ('k') | content/browser/loader/resource_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698