Commit 8060b030 authored by Livvie Lin's avatar Livvie Lin Committed by Commit Bot

Change name of IDS_EDITED_NONSECURE_SUMMARY

Since the override summary is used in some cases even when a form was
not edited, i.e. kMarkHttpAsParameterDangerous, a different name would
be more descriptive.

Also add checks in the browser test that this summary is present.

Change-Id: I294c68b0e57d2a87b501960185b7c91b2a3e0ce3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1507319Reviewed-by: default avatarEmily Stark <estark@chromium.org>
Commit-Queue: Livvie Lin <livvielin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638671}
parent 04bc471a
...@@ -1752,6 +1752,10 @@ IN_PROC_BROWSER_TEST_P(SecurityStateTabHelperTest, ...@@ -1752,6 +1752,10 @@ IN_PROC_BROWSER_TEST_P(SecurityStateTabHelperTest,
helper->GetSecurityInfo(&security_info); helper->GetSecurityInfo(&security_info);
EXPECT_EQ(security_state::DANGEROUS, security_info.security_level); EXPECT_EQ(security_state::DANGEROUS, security_info.security_level);
EXPECT_EQ(blink::kWebSecurityStyleInsecure, observer.latest_security_style()); EXPECT_EQ(blink::kWebSecurityStyleInsecure, observer.latest_security_style());
const content::SecurityStyleExplanations& http_explanation =
observer.latest_explanations();
EXPECT_EQ(l10n_util::GetStringUTF8(IDS_HTTP_NONSECURE_SUMMARY),
http_explanation.summary);
} }
// Visit a valid HTTPS page, then a broken HTTPS page, and then go back, // Visit a valid HTTPS page, then a broken HTTPS page, and then go back,
...@@ -2027,6 +2031,10 @@ IN_PROC_BROWSER_TEST_P(SecurityStateTabHelperTest, ...@@ -2027,6 +2031,10 @@ IN_PROC_BROWSER_TEST_P(SecurityStateTabHelperTest,
// Verify that the security state degrades as expected. // Verify that the security state degrades as expected.
helper->GetSecurityInfo(&security_info); helper->GetSecurityInfo(&security_info);
EXPECT_EQ(security_state::DANGEROUS, security_info.security_level); EXPECT_EQ(security_state::DANGEROUS, security_info.security_level);
const content::SecurityStyleExplanations& http_explanation =
observer.latest_explanations();
EXPECT_EQ(l10n_util::GetStringUTF8(IDS_HTTP_NONSECURE_SUMMARY),
http_explanation.summary);
// Verify security state stays degraded after same-page navigation. // Verify security state stays degraded after same-page navigation.
ui_test_utils::NavigateToURL( ui_test_utils::NavigateToURL(
......
...@@ -64,7 +64,7 @@ void ExplainHTTPSecurity( ...@@ -64,7 +64,7 @@ void ExplainHTTPSecurity(
if (security_info.security_level == security_state::DANGEROUS && if (security_info.security_level == security_state::DANGEROUS &&
!security_info.scheme_is_cryptographic) { !security_info.scheme_is_cryptographic) {
security_style_explanations->summary = security_style_explanations->summary =
l10n_util::GetStringUTF8(IDS_EDITED_NONSECURE_SUMMARY); l10n_util::GetStringUTF8(IDS_HTTP_NONSECURE_SUMMARY);
if (security_info.insecure_input_events.insecure_field_edited) { if (security_info.insecure_input_events.insecure_field_edited) {
security_style_explanations->insecure_explanations.push_back( security_style_explanations->insecure_explanations.push_back(
content::SecurityStyleExplanation( content::SecurityStyleExplanation(
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<grit-part> <grit-part>
<!-- Strings describing Chrome security policy for DevTools security panel --> <!-- Strings describing Chrome security policy for DevTools security panel -->
<message name="IDS_EDITED_NONSECURE_SUMMARY" desc="Main summary for an HTTP page where a user has entered data in a form field." translateable="false"> <message name="IDS_HTTP_NONSECURE_SUMMARY" desc="Main summary for where the site is non-secure HTTP." translateable="false">
This page is insecure (unencrypted HTTP). This page is insecure (unencrypted HTTP).
</message> </message>
<message name="IDS_EDITED_NONSECURE" desc="Summary phrase for a security problem where the site is non-secure (HTTP) and user has entered data in a form field." translateable="false"> <message name="IDS_EDITED_NONSECURE" desc="Summary phrase for a security problem where the site is non-secure (HTTP) and user has entered data in a form field." translateable="false">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment