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

Unified Diff: components/security_state/security_state_model_unittest.cc

Issue 2224023003: Teach SecurityStateModel about subresources with cert errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « components/security_state/security_state_model.cc ('k') | content/public/common/ssl_status.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/security_state/security_state_model_unittest.cc
diff --git a/components/security_state/security_state_model_unittest.cc b/components/security_state/security_state_model_unittest.cc
index f5a2d989e8cad6eee4936820c9fbaef878678a74..3a61c7512b280357790eb2bb587114044514405a 100644
--- a/components/security_state/security_state_model_unittest.cc
+++ b/components/security_state/security_state_model_unittest.cc
@@ -28,7 +28,9 @@ class TestSecurityStateModelClient : public SecurityStateModelClient {
<< net::SSL_CONNECTION_VERSION_SHIFT),
cert_status_(net::CERT_STATUS_SHA1_SIGNATURE_PRESENT),
displayed_mixed_content_(false),
- ran_mixed_content_(false) {
+ ran_mixed_content_(false),
+ displayed_content_with_cert_errors_(false),
+ ran_content_with_cert_errors_(false) {
cert_ =
net::ImportCertFromFile(net::GetTestCertsDirectory(), "sha1_2016.pem");
}
@@ -49,6 +51,13 @@ class TestSecurityStateModelClient : public SecurityStateModelClient {
void SetRanMixedContent(bool ran_mixed_content) {
ran_mixed_content_ = ran_mixed_content;
}
+ void SetDisplayedContentWithCertErrors(
+ bool displayed_content_with_cert_errors) {
+ displayed_content_with_cert_errors_ = displayed_content_with_cert_errors;
+ }
+ void SetRanContentWithCertErrors(bool ran_content_with_cert_errors) {
+ ran_content_with_cert_errors_ = ran_content_with_cert_errors;
+ }
void set_initial_security_level(
SecurityStateModel::SecurityLevel security_level) {
initial_security_level_ = security_level;
@@ -66,6 +75,9 @@ class TestSecurityStateModelClient : public SecurityStateModelClient {
state->security_bits = 256;
state->displayed_mixed_content = displayed_mixed_content_;
state->ran_mixed_content = ran_mixed_content_;
+ state->displayed_content_with_cert_errors =
+ displayed_content_with_cert_errors_;
+ state->ran_content_with_cert_errors = ran_content_with_cert_errors_;
}
bool RetrieveCert(scoped_refptr<net::X509Certificate>* cert) override {
@@ -86,6 +98,8 @@ class TestSecurityStateModelClient : public SecurityStateModelClient {
net::CertStatus cert_status_;
bool displayed_mixed_content_;
bool ran_mixed_content_;
+ bool displayed_content_with_cert_errors_;
+ bool ran_content_with_cert_errors_;
};
// Tests that SHA1-signed certificates expiring in 2016 downgrade the
« no previous file with comments | « components/security_state/security_state_model.cc ('k') | content/public/common/ssl_status.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698