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

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

Issue 2727353002: Ensure GetSecurityStyle sets correct explanations for HTTP_SHOW_WARNING (Closed)
Patch Set: Address estark feedback Created 3 years, 10 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 | « no previous file | components/components_chromium_strings.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c66dfdc3ee89af6d61fd5e4ad008636f04436ae8..3ae0d3e85c65b37e2a40773e8f11e753581ee33e 100644
--- a/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc
+++ b/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc
@@ -796,6 +796,8 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest,
browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(contents);
+ SecurityStyleTestObserver observer(contents);
+
SecurityStateTabHelper* helper =
SecurityStateTabHelper::FromWebContents(contents);
ASSERT_TRUE(helper);
@@ -805,6 +807,13 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest,
helper->GetSecurityInfo(&security_info);
EXPECT_EQ(security_state::HTTP_SHOW_WARNING, security_info.security_level);
+ // Ensure that WebContentsObservers don't show an incorrect Form Not Secure
+ // explanation. Regression test for https://crbug.com/691412.
+ EXPECT_EQ(0u,
+ observer.latest_explanations().unauthenticated_explanations.size());
+ EXPECT_EQ(blink::WebSecurityStyleUnauthenticated,
+ observer.latest_security_style());
+
content::NavigationEntry* entry = contents->GetController().GetVisibleEntry();
ASSERT_TRUE(entry);
EXPECT_EQ(content::SSLStatus::NORMAL_CONTENT, entry->GetSSL().content_status);
« no previous file with comments | « no previous file | components/components_chromium_strings.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698