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

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

Issue 2616553002: Remove obsolete SHA-1 UX elements (Closed)
Patch Set: Address Emily's feedback Created 3 years, 11 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/security_state_tab_helper_browser_tests.cc
diff --git a/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc b/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc
index e503b432b484779a2e280c3d7c574c6c5db8ecb0..4586c9389681bf4f2712dbbde7a5490702931090 100644
--- a/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc
+++ b/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc
@@ -205,7 +205,7 @@ void CheckSecureExplanations(
void CheckSecurityInfoForSecure(
content::WebContents* contents,
security_state::SecurityLevel expect_security_level,
- security_state::SHA1DeprecationStatus expect_sha1_status,
+ bool expect_sha1_in_chain,
security_state::ContentStatus expect_mixed_content_status,
bool pkp_bypassed,
bool expect_cert_error) {
@@ -217,7 +217,7 @@ void CheckSecurityInfoForSecure(
security_state::SecurityInfo security_info;
helper->GetSecurityInfo(&security_info);
EXPECT_EQ(expect_security_level, security_info.security_level);
- EXPECT_EQ(expect_sha1_status, security_info.sha1_deprecation_status);
+ EXPECT_EQ(expect_sha1_in_chain, security_info.sha1_in_chain);
EXPECT_EQ(expect_mixed_content_status, security_info.mixed_content_status);
EXPECT_TRUE(security_info.sct_verify_statuses.empty());
EXPECT_TRUE(security_info.scheme_is_cryptographic);
@@ -237,8 +237,7 @@ void CheckSecurityInfoForNonSecure(content::WebContents* contents) {
security_state::SecurityInfo security_info;
helper->GetSecurityInfo(&security_info);
EXPECT_EQ(security_state::NONE, security_info.security_level);
- EXPECT_EQ(security_state::NO_DEPRECATED_SHA1,
- security_info.sha1_deprecation_status);
+ EXPECT_EQ(false, security_info.sha1_in_chain);
estark 2017/01/08 16:39:58 nit: EXPECT_FALSE
elawrence 2017/01/09 18:13:11 Done.
EXPECT_EQ(security_state::CONTENT_STATUS_NONE,
security_info.mixed_content_status);
EXPECT_TRUE(security_info.sct_verify_statuses.empty());
@@ -369,8 +368,7 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, HttpPage) {
security_state::SecurityInfo security_info;
helper->GetSecurityInfo(&security_info);
EXPECT_EQ(security_state::NONE, security_info.security_level);
- EXPECT_EQ(security_state::NO_DEPRECATED_SHA1,
- security_info.sha1_deprecation_status);
+ EXPECT_EQ(false, security_info.sha1_in_chain);
estark 2017/01/08 16:39:58 nit: EXPECT_FALSE
elawrence 2017/01/09 18:13:11 Done.
EXPECT_EQ(security_state::CONTENT_STATUS_NONE,
security_info.mixed_content_status);
EXPECT_TRUE(security_info.sct_verify_statuses.empty());
@@ -389,8 +387,7 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, HttpsPage) {
https_server_.GetURL("/ssl/google.html"));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::SECURE, security_state::NO_DEPRECATED_SHA1,
- security_state::CONTENT_STATUS_NONE, false,
+ security_state::SECURE, false, security_state::CONTENT_STATUS_NONE, false,
false /* expect cert status error */);
}
@@ -403,8 +400,7 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, SHA1Certificate) {
https_server_.GetURL("/ssl/google.html"));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::DANGEROUS, security_state::DEPRECATED_SHA1_MAJOR,
- security_state::CONTENT_STATUS_NONE, false,
+ security_state::NONE, true, security_state::CONTENT_STATUS_NONE, false,
estark 2017/01/08 16:39:58 Could you add: - a SecurityStyleTestObserver to th
elawrence 2017/01/09 18:13:11 Done.
false /* expect cert status error */);
}
@@ -427,9 +423,8 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContent) {
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::NONE, security_state::NO_DEPRECATED_SHA1,
- security_state::CONTENT_STATUS_DISPLAYED, false,
- false /* expect cert status error */);
+ security_state::NONE, false, security_state::CONTENT_STATUS_DISPLAYED,
+ false, false /* expect cert status error */);
// Navigate to an HTTPS page that displays mixed content dynamically.
GetFilePathWithHostAndPortReplacement(
@@ -439,8 +434,7 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContent) {
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::SECURE, security_state::NO_DEPRECATED_SHA1,
- security_state::CONTENT_STATUS_NONE, false,
+ security_state::SECURE, false, security_state::CONTENT_STATUS_NONE, false,
false /* expect cert status error */);
// Load the insecure image.
bool js_result = false;
@@ -450,9 +444,8 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContent) {
EXPECT_TRUE(js_result);
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::NONE, security_state::NO_DEPRECATED_SHA1,
- security_state::CONTENT_STATUS_DISPLAYED, false,
- false /* expect cert status error */);
+ security_state::NONE, false, security_state::CONTENT_STATUS_DISPLAYED,
+ false, false /* expect cert status error */);
// Navigate to an HTTPS page that runs mixed content.
GetFilePathWithHostAndPortReplacement("/ssl/page_runs_insecure_content.html",
@@ -461,9 +454,8 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContent) {
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::DANGEROUS, security_state::NO_DEPRECATED_SHA1,
- security_state::CONTENT_STATUS_RAN, false,
- false /* expect cert status error */);
+ security_state::DANGEROUS, false, security_state::CONTENT_STATUS_RAN,
+ false, false /* expect cert status error */);
// Navigate to an HTTPS page that runs and displays mixed content.
GetFilePathWithHostAndPortReplacement(
@@ -473,7 +465,7 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContent) {
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::DANGEROUS, security_state::NO_DEPRECATED_SHA1,
+ security_state::DANGEROUS, false,
security_state::CONTENT_STATUS_DISPLAYED_AND_RAN, false,
false /* expect cert status error */);
@@ -493,9 +485,8 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContent) {
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::DANGEROUS, security_state::NO_DEPRECATED_SHA1,
- security_state::CONTENT_STATUS_RAN, false,
- false /* expect cert status error */);
+ security_state::DANGEROUS, false, security_state::CONTENT_STATUS_RAN,
+ false, false /* expect cert status error */);
}
IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest,
@@ -587,7 +578,7 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest,
security_info.content_with_cert_errors_status);
}
-// Same as the test above but with a long-lived SHA1 cert.
+// Same as the test above but with a SHA1 cert.
estark 2017/01/08 16:39:58 nit: while you are here, could you change "test ab
elawrence 2017/01/09 18:13:11 Done.
IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContentWithSHA1Cert) {
ASSERT_TRUE(embedded_test_server()->Start());
ASSERT_TRUE(https_server_.Start());
@@ -609,9 +600,8 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContentWithSHA1Cert) {
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::DANGEROUS, security_state::DEPRECATED_SHA1_MAJOR,
- security_state::CONTENT_STATUS_DISPLAYED, false,
- false /* expect cert status error */);
+ security_state::NONE, true, security_state::CONTENT_STATUS_DISPLAYED,
+ false, false /* expect cert status error */);
// Navigate to an HTTPS page that displays mixed content dynamically.
GetFilePathWithHostAndPortReplacement(
@@ -621,8 +611,7 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContentWithSHA1Cert) {
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::DANGEROUS, security_state::DEPRECATED_SHA1_MAJOR,
- security_state::CONTENT_STATUS_NONE, false,
+ security_state::NONE, true, security_state::CONTENT_STATUS_NONE, false,
false /* expect cert status error */);
// Load the insecure image.
bool js_result = false;
@@ -632,9 +621,8 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContentWithSHA1Cert) {
EXPECT_TRUE(js_result);
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::DANGEROUS, security_state::DEPRECATED_SHA1_MAJOR,
- security_state::CONTENT_STATUS_DISPLAYED, false,
- false /* expect cert status error */);
+ security_state::NONE, true, security_state::CONTENT_STATUS_DISPLAYED,
+ false, false /* expect cert status error */);
// Navigate to an HTTPS page that runs mixed content.
GetFilePathWithHostAndPortReplacement("/ssl/page_runs_insecure_content.html",
@@ -643,9 +631,8 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContentWithSHA1Cert) {
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::DANGEROUS, security_state::DEPRECATED_SHA1_MAJOR,
- security_state::CONTENT_STATUS_RAN, false,
- false /* expect cert status error */);
+ security_state::DANGEROUS, true, security_state::CONTENT_STATUS_RAN,
+ false, false /* expect cert status error */);
// Navigate to an HTTPS page that runs and displays mixed content.
GetFilePathWithHostAndPortReplacement(
@@ -655,7 +642,7 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContentWithSHA1Cert) {
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::DANGEROUS, security_state::DEPRECATED_SHA1_MAJOR,
+ security_state::DANGEROUS, true,
security_state::CONTENT_STATUS_DISPLAYED_AND_RAN, false,
false /* expect cert status error */);
}
@@ -681,8 +668,7 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContentStrictBlocking) {
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::SECURE, security_state::NO_DEPRECATED_SHA1,
- security_state::CONTENT_STATUS_NONE, false,
+ security_state::SECURE, false, security_state::CONTENT_STATUS_NONE, false,
false /* expect cert status error */);
}
@@ -696,18 +682,16 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, BrokenHTTPS) {
https_server_.GetURL("/ssl/google.html"));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::DANGEROUS, security_state::NO_DEPRECATED_SHA1,
- security_state::CONTENT_STATUS_NONE, false,
- true /* expect cert status error */);
+ security_state::DANGEROUS, false, security_state::CONTENT_STATUS_NONE,
+ false, true /* expect cert status error */);
ProceedThroughInterstitial(
browser()->tab_strip_model()->GetActiveWebContents());
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::DANGEROUS, security_state::NO_DEPRECATED_SHA1,
- security_state::CONTENT_STATUS_NONE, false,
- true /* expect cert status error */);
+ security_state::DANGEROUS, false, security_state::CONTENT_STATUS_NONE,
+ false, true /* expect cert status error */);
// Navigate to a broken HTTPS page that displays mixed content.
std::string replacement_path;
@@ -718,7 +702,7 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, BrokenHTTPS) {
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::DANGEROUS, security_state::NO_DEPRECATED_SHA1,
+ security_state::DANGEROUS, false,
security_state::CONTENT_STATUS_DISPLAYED, false,
true /* expect cert status error */);
}
@@ -779,8 +763,8 @@ IN_PROC_BROWSER_TEST_F(PKPModelClientTest, PKPBypass) {
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::SECURE, security_state::NO_DEPRECATED_SHA1,
- security_state::CONTENT_STATUS_NONE, true, false);
+ security_state::SECURE, false, security_state::CONTENT_STATUS_NONE, true,
+ false);
const content::SecurityStyleExplanations& explanation =
observer.latest_explanations();
@@ -865,8 +849,7 @@ IN_PROC_BROWSER_TEST_F(SecurityStateLoadingTest, NavigationStateChanges) {
https_server_.GetURL("/ssl/google.html"));
CheckSecurityInfoForSecure(
browser()->tab_strip_model()->GetActiveWebContents(),
- security_state::SECURE, security_state::NO_DEPRECATED_SHA1,
- security_state::CONTENT_STATUS_NONE, false,
+ security_state::SECURE, false, security_state::CONTENT_STATUS_NONE, false,
false /* expect cert status error */);
// Navigate to a page that doesn't finish loading. Test that the
@@ -1479,15 +1462,13 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, AddedTab) {
controller.LoadURL(https_server_.GetURL("/title1.html"), content::Referrer(),
ui::PAGE_TRANSITION_TYPED, std::string());
EXPECT_TRUE(content::WaitForLoadStop(new_contents));
- CheckSecurityInfoForSecure(new_contents, security_state::SECURE,
- security_state::NO_DEPRECATED_SHA1,
+ CheckSecurityInfoForSecure(new_contents, security_state::SECURE, false,
security_state::CONTENT_STATUS_NONE, false,
false /* expect cert status error */);
browser()->tab_strip_model()->InsertWebContentsAt(0, new_contents,
TabStripModel::ADD_NONE);
- CheckSecurityInfoForSecure(new_contents, security_state::SECURE,
- security_state::NO_DEPRECATED_SHA1,
+ CheckSecurityInfoForSecure(new_contents, security_state::SECURE, false,
security_state::CONTENT_STATUS_NONE, false,
false /* expect cert status error */);
}

Powered by Google App Engine
This is Rietveld 408576698