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

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

Issue 2660333003: [Merge M-57] Display "Not secure" verbose state for data: URLs (Closed)
Patch Set: 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 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 SecurityStateTabHelper* helper = 1226 SecurityStateTabHelper* helper =
1227 SecurityStateTabHelper::FromWebContents(contents); 1227 SecurityStateTabHelper::FromWebContents(contents);
1228 ASSERT_TRUE(helper); 1228 ASSERT_TRUE(helper);
1229 1229
1230 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); 1230 ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
1231 security_state::SecurityInfo security_info; 1231 security_state::SecurityInfo security_info;
1232 helper->GetSecurityInfo(&security_info); 1232 helper->GetSecurityInfo(&security_info);
1233 EXPECT_EQ(security_state::NONE, security_info.security_level); 1233 EXPECT_EQ(security_state::NONE, security_info.security_level);
1234 } 1234 }
1235 1235
1236 // Data URLs should always be marked as non-secure.
1236 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkDataAsNonSecure) { 1237 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkDataAsNonSecure) {
1237 scoped_refptr<base::FieldTrial> trial =
1238 base::FieldTrialList::CreateFieldTrial(
1239 "MarkNonSecureAs", security_state::switches::kMarkHttpAsDangerous);
1240
1241 content::WebContents* contents = 1238 content::WebContents* contents =
1242 browser()->tab_strip_model()->GetActiveWebContents(); 1239 browser()->tab_strip_model()->GetActiveWebContents();
1243 ASSERT_TRUE(contents); 1240 ASSERT_TRUE(contents);
1244 1241
1245 SecurityStateTabHelper* helper = 1242 SecurityStateTabHelper* helper =
1246 SecurityStateTabHelper::FromWebContents(contents); 1243 SecurityStateTabHelper::FromWebContents(contents);
1247 ASSERT_TRUE(helper); 1244 ASSERT_TRUE(helper);
1248 1245
1249 ui_test_utils::NavigateToURL(browser(), GURL("data:text/plain,hello")); 1246 ui_test_utils::NavigateToURL(browser(), GURL("data:text/plain,hello"));
1250 security_state::SecurityInfo security_info; 1247 security_state::SecurityInfo security_info;
1251 helper->GetSecurityInfo(&security_info); 1248 helper->GetSecurityInfo(&security_info);
1252 EXPECT_EQ(security_state::NONE, security_info.security_level); 1249 EXPECT_EQ(security_state::HTTP_SHOW_WARNING, security_info.security_level);
1253 } 1250 }
1254 1251
1255 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkBlobAsNonSecure) { 1252 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkBlobAsNonSecure) {
1256 scoped_refptr<base::FieldTrial> trial = 1253 scoped_refptr<base::FieldTrial> trial =
1257 base::FieldTrialList::CreateFieldTrial( 1254 base::FieldTrialList::CreateFieldTrial(
1258 "MarkNonSecureAs", security_state::switches::kMarkHttpAsDangerous); 1255 "MarkNonSecureAs", security_state::switches::kMarkHttpAsDangerous);
1259 1256
1260 content::WebContents* contents = 1257 content::WebContents* contents =
1261 browser()->tab_strip_model()->GetActiveWebContents(); 1258 browser()->tab_strip_model()->GetActiveWebContents();
1262 ASSERT_TRUE(contents); 1259 ASSERT_TRUE(contents);
(...skipping 2625 matching lines...) Expand 10 before | Expand all | Expand 10 after
3888 3885
3889 // Visit a page over https that contains a frame with a redirect. 3886 // Visit a page over https that contains a frame with a redirect.
3890 3887
3891 // XMLHttpRequest insecure content in synchronous mode. 3888 // XMLHttpRequest insecure content in synchronous mode.
3892 3889
3893 // XMLHttpRequest insecure content in asynchronous mode. 3890 // XMLHttpRequest insecure content in asynchronous mode.
3894 3891
3895 // XMLHttpRequest over bad ssl in synchronous mode. 3892 // XMLHttpRequest over bad ssl in synchronous mode.
3896 3893
3897 // XMLHttpRequest over OK ssl in synchronous mode. 3894 // 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