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

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

Issue 1659163006: Teach navigation throttles how to cancel requests in WillProcessResponse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable the test on WIN. Created 4 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
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_handle_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 ProceedThroughInterstitial(tab); 1113 ProceedThroughInterstitial(tab);
1114 1114
1115 // Test page run a WebSocket wss connection test. The result will be shown 1115 // Test page run a WebSocket wss connection test. The result will be shown
1116 // as page title. 1116 // as page title.
1117 const base::string16 result = watcher.WaitAndGetTitle(); 1117 const base::string16 result = watcher.WaitAndGetTitle();
1118 EXPECT_TRUE(base::LowerCaseEqualsASCII(result, "pass")); 1118 EXPECT_TRUE(base::LowerCaseEqualsASCII(result, "pass"));
1119 } 1119 }
1120 1120
1121 // Ensure that non-standard origins are marked correctly when the 1121 // Ensure that non-standard origins are marked correctly when the
1122 // MarkNonSecureAs field trial is enabled. 1122 // MarkNonSecureAs field trial is enabled.
1123 IN_PROC_BROWSER_TEST_F(SSLUITest, TestMarkNonSecureAs) { 1123 //
1124 // Disabled on Windows until `file:///` navigation works under OOPIF.
1125 // https://crbug.com/574997
1126 #if defined(OS_WIN)
1127 #define MAYBE_MarkFileAsNonSecure DISABLED_MarkFileAsNonSecure
1128 #else
1129 #define MAYBE_MarkFileAsNonSecure MarkFileAsNonSecure
1130 #endif
1131 IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_MarkFileAsNonSecure) {
1124 scoped_refptr<base::FieldTrial> trial = 1132 scoped_refptr<base::FieldTrial> trial =
1125 base::FieldTrialList::CreateFieldTrial( 1133 base::FieldTrialList::CreateFieldTrial(
1126 "MarkNonSecureAs", 1134 "MarkNonSecureAs",
1127 security_state::switches::kMarkNonSecureAsNonSecure); 1135 security_state::switches::kMarkNonSecureAsNonSecure);
1128 1136
1129 content::WebContents* contents = 1137 content::WebContents* contents =
1130 browser()->tab_strip_model()->GetActiveWebContents(); 1138 browser()->tab_strip_model()->GetActiveWebContents();
1131 ASSERT_TRUE(contents); 1139 ASSERT_TRUE(contents);
1132 1140
1133 ChromeSecurityStateModelClient* model_client = 1141 ChromeSecurityStateModelClient* model_client =
1134 ChromeSecurityStateModelClient::FromWebContents(contents); 1142 ChromeSecurityStateModelClient::FromWebContents(contents);
1135 ASSERT_TRUE(model_client); 1143 ASSERT_TRUE(model_client);
1136 1144
1137 ui_test_utils::NavigateToURL(browser(), GURL("file:/")); 1145 ui_test_utils::NavigateToURL(browser(), GURL("file:///"));
1138 EXPECT_EQ(security_state::SecurityStateModel::NONE, 1146 EXPECT_EQ(security_state::SecurityStateModel::NONE,
1139 model_client->GetSecurityInfo().security_level); 1147 model_client->GetSecurityInfo().security_level);
1148 }
1149
1150 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkAboutAsNonSecure) {
1151 scoped_refptr<base::FieldTrial> trial =
1152 base::FieldTrialList::CreateFieldTrial(
1153 "MarkNonSecureAs",
1154 security_state::switches::kMarkNonSecureAsNonSecure);
1155
1156 content::WebContents* contents =
1157 browser()->tab_strip_model()->GetActiveWebContents();
1158 ASSERT_TRUE(contents);
1159
1160 ChromeSecurityStateModelClient* model_client =
1161 ChromeSecurityStateModelClient::FromWebContents(contents);
1162 ASSERT_TRUE(model_client);
1140 1163
1141 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); 1164 ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
1142 EXPECT_EQ(security_state::SecurityStateModel::NONE, 1165 EXPECT_EQ(security_state::SecurityStateModel::NONE,
1143 model_client->GetSecurityInfo().security_level); 1166 model_client->GetSecurityInfo().security_level);
1167 }
1168
1169 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkDataAsNonSecure) {
1170 scoped_refptr<base::FieldTrial> trial =
1171 base::FieldTrialList::CreateFieldTrial(
1172 "MarkNonSecureAs",
1173 security_state::switches::kMarkNonSecureAsNonSecure);
1174
1175 content::WebContents* contents =
1176 browser()->tab_strip_model()->GetActiveWebContents();
1177 ASSERT_TRUE(contents);
1178
1179 ChromeSecurityStateModelClient* model_client =
1180 ChromeSecurityStateModelClient::FromWebContents(contents);
1181 ASSERT_TRUE(model_client);
1144 1182
1145 ui_test_utils::NavigateToURL(browser(), GURL("data:text/plain,hello")); 1183 ui_test_utils::NavigateToURL(browser(), GURL("data:text/plain,hello"));
1146 EXPECT_EQ(security_state::SecurityStateModel::NONE, 1184 EXPECT_EQ(security_state::SecurityStateModel::NONE,
1147 model_client->GetSecurityInfo().security_level); 1185 model_client->GetSecurityInfo().security_level);
1186 }
1187
1188 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkBlobAsNonSecure) {
1189 scoped_refptr<base::FieldTrial> trial =
1190 base::FieldTrialList::CreateFieldTrial(
1191 "MarkNonSecureAs",
1192 security_state::switches::kMarkNonSecureAsNonSecure);
1193
1194 content::WebContents* contents =
1195 browser()->tab_strip_model()->GetActiveWebContents();
1196 ASSERT_TRUE(contents);
1197
1198 ChromeSecurityStateModelClient* model_client =
1199 ChromeSecurityStateModelClient::FromWebContents(contents);
1200 ASSERT_TRUE(model_client);
1148 1201
1149 ui_test_utils::NavigateToURL( 1202 ui_test_utils::NavigateToURL(
1150 browser(), 1203 browser(),
1151 GURL("blob:chrome%3A//newtab/49a463bb-fac8-476c-97bf-5d7076c3ea1a")); 1204 GURL("blob:chrome%3A//newtab/49a463bb-fac8-476c-97bf-5d7076c3ea1a"));
1152 EXPECT_EQ(security_state::SecurityStateModel::NONE, 1205 EXPECT_EQ(security_state::SecurityStateModel::NONE,
1153 model_client->GetSecurityInfo().security_level); 1206 model_client->GetSecurityInfo().security_level);
1154 } 1207 }
1155 1208
1156 #if defined(USE_NSS_CERTS) 1209 #if defined(USE_NSS_CERTS)
1157 class SSLUITestWithClientCert : public SSLUITest { 1210 class SSLUITestWithClientCert : public SSLUITest {
(...skipping 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after
2931 2984
2932 // Visit a page over https that contains a frame with a redirect. 2985 // Visit a page over https that contains a frame with a redirect.
2933 2986
2934 // XMLHttpRequest insecure content in synchronous mode. 2987 // XMLHttpRequest insecure content in synchronous mode.
2935 2988
2936 // XMLHttpRequest insecure content in asynchronous mode. 2989 // XMLHttpRequest insecure content in asynchronous mode.
2937 2990
2938 // XMLHttpRequest over bad ssl in synchronous mode. 2991 // XMLHttpRequest over bad ssl in synchronous mode.
2939 2992
2940 // XMLHttpRequest over OK ssl in synchronous mode. 2993 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_handle_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698