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

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: Update SecurityStateContentUtilsTest 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
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..1a23c4e308c28f3ba615d1c20c1322532d7a78bc 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,11 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest,
helper->GetSecurityInfo(&security_info);
EXPECT_EQ(security_state::HTTP_SHOW_WARNING, security_info.security_level);
+ // Ensure Developer Tools don't show an incorrect Form Not Secure explanation.
estark 2017/03/02 22:53:33 layering-and-comment nit: it's mildly undesirable
elawrence 2017/03/02 23:11:43 Done.
+ const content::SecurityStyleExplanations& explanations =
+ observer.latest_explanations();
estark 2017/03/02 22:53:33 Perhaps also check that latest_security_style() is
elawrence 2017/03/02 23:11:43 Done.
+ EXPECT_EQ(0u, explanations.unauthenticated_explanations.size());
estark 2017/03/02 22:53:33 optional nit: since you're only using it once, I'd
elawrence 2017/03/02 23:11:43 Done.
+
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') | components/security_state/content/content_utils.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698