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

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

Issue 2666783006: [Merge M-56] Display "Not secure" verbose state for data: URLs (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_browser_tests.cc » ('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 f83ffeff9df0a7ae10af0a2cc585672616b600ea..601be4958d0028844c1127de57cffc914ae83b6d 100644
--- a/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc
+++ b/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc
@@ -733,6 +733,28 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, BrokenHTTPS) {
true /* expect cert status error */);
}
+// Tests that the security level of data: URLs is always downgraded to
+// HTTP_SHOW_WARNING.
+IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest,
+ SecurityLevelDowngradedOnDataUrl) {
+ content::WebContents* contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ ASSERT_TRUE(contents);
+
+ SecurityStateTabHelper* helper =
+ SecurityStateTabHelper::FromWebContents(contents);
+ ASSERT_TRUE(helper);
+
+ ui_test_utils::NavigateToURL(browser(), GURL("data:text/html,<html></html>"));
+ security_state::SecurityInfo security_info;
+ helper->GetSecurityInfo(&security_info);
+ EXPECT_EQ(security_state::HTTP_SHOW_WARNING, security_info.security_level);
+
+ content::NavigationEntry* entry = contents->GetController().GetVisibleEntry();
+ ASSERT_TRUE(entry);
+ EXPECT_EQ(content::SSLStatus::NORMAL_CONTENT, entry->GetSSL().content_status);
+}
+
const char kReportURI[] = "https://report-hpkp.test";
class PKPModelClientTest : public SecurityStateTabHelperTest {
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698