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

Side by Side Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 2648353005: Display "Not secure" verbose state for data: URLs (Closed)
Patch Set: estark comments 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <utility> 5 #include <utility>
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 SecurityStateTabHelper* helper = 1228 SecurityStateTabHelper* helper =
1229 SecurityStateTabHelper::FromWebContents(contents); 1229 SecurityStateTabHelper::FromWebContents(contents);
1230 ASSERT_TRUE(helper); 1230 ASSERT_TRUE(helper);
1231 1231
1232 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); 1232 ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
1233 security_state::SecurityInfo security_info; 1233 security_state::SecurityInfo security_info;
1234 helper->GetSecurityInfo(&security_info); 1234 helper->GetSecurityInfo(&security_info);
1235 EXPECT_EQ(security_state::NONE, security_info.security_level); 1235 EXPECT_EQ(security_state::NONE, security_info.security_level);
1236 } 1236 }
1237 1237
1238 // Data URLs should always be marked as non-secure.
1238 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkDataAsNonSecure) { 1239 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkDataAsNonSecure) {
1239 scoped_refptr<base::FieldTrial> trial =
1240 base::FieldTrialList::CreateFieldTrial(
1241 "MarkNonSecureAs", security_state::switches::kMarkHttpAsDangerous);
1242
1243 content::WebContents* contents = 1240 content::WebContents* contents =
1244 browser()->tab_strip_model()->GetActiveWebContents(); 1241 browser()->tab_strip_model()->GetActiveWebContents();
1245 ASSERT_TRUE(contents); 1242 ASSERT_TRUE(contents);
1246 1243
1247 SecurityStateTabHelper* helper = 1244 SecurityStateTabHelper* helper =
1248 SecurityStateTabHelper::FromWebContents(contents); 1245 SecurityStateTabHelper::FromWebContents(contents);
1249 ASSERT_TRUE(helper); 1246 ASSERT_TRUE(helper);
1250 1247
1251 ui_test_utils::NavigateToURL(browser(), GURL("data:text/plain,hello")); 1248 ui_test_utils::NavigateToURL(browser(), GURL("data:text/plain,hello"));
1252 security_state::SecurityInfo security_info; 1249 security_state::SecurityInfo security_info;
1253 helper->GetSecurityInfo(&security_info); 1250 helper->GetSecurityInfo(&security_info);
1254 EXPECT_EQ(security_state::NONE, security_info.security_level); 1251 EXPECT_EQ(security_state::HTTP_SHOW_WARNING, security_info.security_level);
1255 } 1252 }
1256 1253
1257 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkBlobAsNonSecure) { 1254 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkBlobAsNonSecure) {
1258 scoped_refptr<base::FieldTrial> trial = 1255 scoped_refptr<base::FieldTrial> trial =
1259 base::FieldTrialList::CreateFieldTrial( 1256 base::FieldTrialList::CreateFieldTrial(
1260 "MarkNonSecureAs", security_state::switches::kMarkHttpAsDangerous); 1257 "MarkNonSecureAs", security_state::switches::kMarkHttpAsDangerous);
1261 1258
1262 content::WebContents* contents = 1259 content::WebContents* contents =
1263 browser()->tab_strip_model()->GetActiveWebContents(); 1260 browser()->tab_strip_model()->GetActiveWebContents();
1264 ASSERT_TRUE(contents); 1261 ASSERT_TRUE(contents);
(...skipping 2627 matching lines...) Expand 10 before | Expand all | Expand 10 after
3892 3889
3893 // Visit a page over https that contains a frame with a redirect. 3890 // Visit a page over https that contains a frame with a redirect.
3894 3891
3895 // XMLHttpRequest insecure content in synchronous mode. 3892 // XMLHttpRequest insecure content in synchronous mode.
3896 3893
3897 // XMLHttpRequest insecure content in asynchronous mode. 3894 // XMLHttpRequest insecure content in asynchronous mode.
3898 3895
3899 // XMLHttpRequest over bad ssl in synchronous mode. 3896 // XMLHttpRequest over bad ssl in synchronous mode.
3900 3897
3901 // XMLHttpRequest over OK ssl in synchronous mode. 3898 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « chrome/browser/ssl/security_state_tab_helper_browser_tests.cc ('k') | components/security_state/core/security_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698