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

Unified Diff: chrome/browser/ssl/chrome_security_state_model_client_unittest.cc

Issue 2424223002: Update devtools security panel for HTTP-bad (Closed)
Patch Set: lgarron comments Created 4 years, 2 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: chrome/browser/ssl/chrome_security_state_model_client_unittest.cc
diff --git a/chrome/browser/ssl/chrome_security_state_model_client_unittest.cc b/chrome/browser/ssl/chrome_security_state_model_client_unittest.cc
index 3e933364457064fd3cf7ab5bb2486ccbec68b455..9a50d7bc05b7e937f30a2843530afc2399932d46 100644
--- a/chrome/browser/ssl/chrome_security_state_model_client_unittest.cc
+++ b/chrome/browser/ssl/chrome_security_state_model_client_unittest.cc
@@ -213,4 +213,33 @@ TEST(ChromeSecurityStateModelClientTest, ConnectionExplanation) {
}
}
+// Tests that a security level of HTTP_SHOW_WARNING produces a
+// content::SecurityStyle of UNAUTHENTICATED, with an explanation.
+TEST(ChromeSecurityStateModelClientTest, HTTPWarning) {
+ security_state::SecurityStateModel::SecurityInfo security_info;
+ content::SecurityStyleExplanations explanations;
+ security_info.security_level =
+ security_state::SecurityStateModel::HTTP_SHOW_WARNING;
+ blink::WebSecurityStyle security_style =
+ ChromeSecurityStateModelClient::GetSecurityStyle(security_info,
+ &explanations);
+ EXPECT_EQ(blink::WebSecurityStyleUnauthenticated, security_style);
+ EXPECT_EQ(1u, explanations.unauthenticated_explanations.size());
+}
+
+// Tests that a security level of NONE when there is a password or
+// credit card field on HTTP produces a content::SecurityStyle of
+// UNAUTHENTICATED, with an info explanation.
+TEST(ChromeSecurityStateModelClientTest, HTTPWarningInFuture) {
+ security_state::SecurityStateModel::SecurityInfo security_info;
+ content::SecurityStyleExplanations explanations;
+ security_info.security_level = security_state::SecurityStateModel::NONE;
+ security_info.displayed_private_user_data_input_on_http = true;
+ blink::WebSecurityStyle security_style =
+ ChromeSecurityStateModelClient::GetSecurityStyle(security_info,
+ &explanations);
+ EXPECT_EQ(blink::WebSecurityStyleUnauthenticated, security_style);
+ EXPECT_EQ(1u, explanations.info_explanations.size());
+}
+
} // namespace
« no previous file with comments | « chrome/browser/ssl/chrome_security_state_model_client.cc ('k') | components/security_state/security_state_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698