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

Side by Side Diff: components/security_state/security_state_model_unittest.cc

Issue 2224193003: Rename SecurityStateModel::MIXED_CONTENT_STATUS enum values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « components/security_state/security_state_model.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/security_state/security_state_model.h" 5 #include "components/security_state/security_state_model.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "components/security_state/security_state_model_client.h" 9 #include "components/security_state/security_state_model_client.h"
10 #include "net/cert/x509_certificate.h" 10 #include "net/cert/x509_certificate.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // content. 111 // content.
112 TEST(SecurityStateModelTest, SHA1WarningMixedContent) { 112 TEST(SecurityStateModelTest, SHA1WarningMixedContent) {
113 TestSecurityStateModelClient client; 113 TestSecurityStateModelClient client;
114 SecurityStateModel model; 114 SecurityStateModel model;
115 model.SetClient(&client); 115 model.SetClient(&client);
116 client.SetDisplayedMixedContent(true); 116 client.SetDisplayedMixedContent(true);
117 const SecurityStateModel::SecurityInfo& security_info1 = 117 const SecurityStateModel::SecurityInfo& security_info1 =
118 model.GetSecurityInfo(); 118 model.GetSecurityInfo();
119 EXPECT_EQ(SecurityStateModel::DEPRECATED_SHA1_MINOR, 119 EXPECT_EQ(SecurityStateModel::DEPRECATED_SHA1_MINOR,
120 security_info1.sha1_deprecation_status); 120 security_info1.sha1_deprecation_status);
121 EXPECT_EQ(SecurityStateModel::DISPLAYED_MIXED_CONTENT, 121 EXPECT_EQ(SecurityStateModel::CONTENT_STATUS_DISPLAYED,
122 security_info1.mixed_content_status); 122 security_info1.mixed_content_status);
123 EXPECT_EQ(SecurityStateModel::NONE, security_info1.security_level); 123 EXPECT_EQ(SecurityStateModel::NONE, security_info1.security_level);
124 124
125 client.set_initial_security_level(SecurityStateModel::SECURITY_ERROR); 125 client.set_initial_security_level(SecurityStateModel::SECURITY_ERROR);
126 client.SetDisplayedMixedContent(false); 126 client.SetDisplayedMixedContent(false);
127 client.SetRanMixedContent(true); 127 client.SetRanMixedContent(true);
128 const SecurityStateModel::SecurityInfo& security_info2 = 128 const SecurityStateModel::SecurityInfo& security_info2 =
129 model.GetSecurityInfo(); 129 model.GetSecurityInfo();
130 EXPECT_EQ(SecurityStateModel::DEPRECATED_SHA1_MINOR, 130 EXPECT_EQ(SecurityStateModel::DEPRECATED_SHA1_MINOR,
131 security_info2.sha1_deprecation_status); 131 security_info2.sha1_deprecation_status);
132 EXPECT_EQ(SecurityStateModel::RAN_MIXED_CONTENT, 132 EXPECT_EQ(SecurityStateModel::CONTENT_STATUS_RAN,
133 security_info2.mixed_content_status); 133 security_info2.mixed_content_status);
134 EXPECT_EQ(SecurityStateModel::SECURITY_ERROR, security_info2.security_level); 134 EXPECT_EQ(SecurityStateModel::SECURITY_ERROR, security_info2.security_level);
135 } 135 }
136 136
137 // Tests that SHA1 warnings don't interfere with the handling of major 137 // Tests that SHA1 warnings don't interfere with the handling of major
138 // cert errors. 138 // cert errors.
139 TEST(SecurityStateModelTest, SHA1WarningBrokenHTTPS) { 139 TEST(SecurityStateModelTest, SHA1WarningBrokenHTTPS) {
140 TestSecurityStateModelClient client; 140 TestSecurityStateModelClient client;
141 SecurityStateModel model; 141 SecurityStateModel model;
142 model.SetClient(&client); 142 model.SetClient(&client);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 client.set_fails_malware_check(true); 223 client.set_fails_malware_check(true);
224 const SecurityStateModel::SecurityInfo& security_info = 224 const SecurityStateModel::SecurityInfo& security_info =
225 model.GetSecurityInfo(); 225 model.GetSecurityInfo();
226 EXPECT_TRUE(security_info.fails_malware_check); 226 EXPECT_TRUE(security_info.fails_malware_check);
227 EXPECT_EQ(SecurityStateModel::SECURITY_ERROR, security_info.security_level); 227 EXPECT_EQ(SecurityStateModel::SECURITY_ERROR, security_info.security_level);
228 } 228 }
229 229
230 } // namespace 230 } // namespace
231 231
232 } // namespace security_state 232 } // namespace security_state
OLDNEW
« no previous file with comments | « components/security_state/security_state_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698