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

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

Issue 2666783006: [Merge M-56] 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 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 SecurityStateTabHelper* helper = 1222 SecurityStateTabHelper* helper =
1223 SecurityStateTabHelper::FromWebContents(contents); 1223 SecurityStateTabHelper::FromWebContents(contents);
1224 ASSERT_TRUE(helper); 1224 ASSERT_TRUE(helper);
1225 1225
1226 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); 1226 ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
1227 security_state::SecurityInfo security_info; 1227 security_state::SecurityInfo security_info;
1228 helper->GetSecurityInfo(&security_info); 1228 helper->GetSecurityInfo(&security_info);
1229 EXPECT_EQ(security_state::NONE, security_info.security_level); 1229 EXPECT_EQ(security_state::NONE, security_info.security_level);
1230 } 1230 }
1231 1231
1232 // Data URLs should always be marked as non-secure.
1232 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkDataAsNonSecure) { 1233 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkDataAsNonSecure) {
1233 scoped_refptr<base::FieldTrial> trial =
1234 base::FieldTrialList::CreateFieldTrial(
1235 "MarkNonSecureAs", security_state::switches::kMarkHttpAsDangerous);
1236
1237 content::WebContents* contents = 1234 content::WebContents* contents =
1238 browser()->tab_strip_model()->GetActiveWebContents(); 1235 browser()->tab_strip_model()->GetActiveWebContents();
1239 ASSERT_TRUE(contents); 1236 ASSERT_TRUE(contents);
1240 1237
1241 SecurityStateTabHelper* helper = 1238 SecurityStateTabHelper* helper =
1242 SecurityStateTabHelper::FromWebContents(contents); 1239 SecurityStateTabHelper::FromWebContents(contents);
1243 ASSERT_TRUE(helper); 1240 ASSERT_TRUE(helper);
1244 1241
1245 ui_test_utils::NavigateToURL(browser(), GURL("data:text/plain,hello")); 1242 ui_test_utils::NavigateToURL(browser(), GURL("data:text/plain,hello"));
1246 security_state::SecurityInfo security_info; 1243 security_state::SecurityInfo security_info;
1247 helper->GetSecurityInfo(&security_info); 1244 helper->GetSecurityInfo(&security_info);
1248 EXPECT_EQ(security_state::NONE, security_info.security_level); 1245 EXPECT_EQ(security_state::HTTP_SHOW_WARNING, security_info.security_level);
1249 } 1246 }
1250 1247
1251 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkBlobAsNonSecure) { 1248 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkBlobAsNonSecure) {
1252 scoped_refptr<base::FieldTrial> trial = 1249 scoped_refptr<base::FieldTrial> trial =
1253 base::FieldTrialList::CreateFieldTrial( 1250 base::FieldTrialList::CreateFieldTrial(
1254 "MarkNonSecureAs", security_state::switches::kMarkHttpAsDangerous); 1251 "MarkNonSecureAs", security_state::switches::kMarkHttpAsDangerous);
1255 1252
1256 content::WebContents* contents = 1253 content::WebContents* contents =
1257 browser()->tab_strip_model()->GetActiveWebContents(); 1254 browser()->tab_strip_model()->GetActiveWebContents();
1258 ASSERT_TRUE(contents); 1255 ASSERT_TRUE(contents);
(...skipping 2618 matching lines...) Expand 10 before | Expand all | Expand 10 after
3877 3874
3878 // Visit a page over https that contains a frame with a redirect. 3875 // Visit a page over https that contains a frame with a redirect.
3879 3876
3880 // XMLHttpRequest insecure content in synchronous mode. 3877 // XMLHttpRequest insecure content in synchronous mode.
3881 3878
3882 // XMLHttpRequest insecure content in asynchronous mode. 3879 // XMLHttpRequest insecure content in asynchronous mode.
3883 3880
3884 // XMLHttpRequest over bad ssl in synchronous mode. 3881 // XMLHttpRequest over bad ssl in synchronous mode.
3885 3882
3886 // XMLHttpRequest over OK ssl in synchronous mode. 3883 // 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