| OLD | NEW |
| 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 Loading... |
| 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 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkFileAsNonSecure) { |
| 1124 scoped_refptr<base::FieldTrial> trial = | 1124 scoped_refptr<base::FieldTrial> trial = |
| 1125 base::FieldTrialList::CreateFieldTrial( | 1125 base::FieldTrialList::CreateFieldTrial( |
| 1126 "MarkNonSecureAs", | 1126 "MarkNonSecureAs", |
| 1127 security_state::switches::kMarkNonSecureAsNonSecure); | 1127 security_state::switches::kMarkNonSecureAsNonSecure); |
| 1128 | 1128 |
| 1129 content::WebContents* contents = | 1129 content::WebContents* contents = |
| 1130 browser()->tab_strip_model()->GetActiveWebContents(); | 1130 browser()->tab_strip_model()->GetActiveWebContents(); |
| 1131 ASSERT_TRUE(contents); | 1131 ASSERT_TRUE(contents); |
| 1132 | 1132 |
| 1133 ChromeSecurityStateModelClient* model_client = | 1133 ChromeSecurityStateModelClient* model_client = |
| 1134 ChromeSecurityStateModelClient::FromWebContents(contents); | 1134 ChromeSecurityStateModelClient::FromWebContents(contents); |
| 1135 ASSERT_TRUE(model_client); | 1135 ASSERT_TRUE(model_client); |
| 1136 | 1136 |
| 1137 ui_test_utils::NavigateToURL(browser(), GURL("file:/")); | 1137 ui_test_utils::NavigateToURL(browser(), GURL("file:///")); |
| 1138 EXPECT_EQ(security_state::SecurityStateModel::NONE, | 1138 EXPECT_EQ(security_state::SecurityStateModel::NONE, |
| 1139 model_client->GetSecurityInfo().security_level); | 1139 model_client->GetSecurityInfo().security_level); |
| 1140 } |
| 1141 |
| 1142 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkAboutAsNonSecure) { |
| 1143 scoped_refptr<base::FieldTrial> trial = |
| 1144 base::FieldTrialList::CreateFieldTrial( |
| 1145 "MarkNonSecureAs", |
| 1146 security_state::switches::kMarkNonSecureAsNonSecure); |
| 1147 |
| 1148 content::WebContents* contents = |
| 1149 browser()->tab_strip_model()->GetActiveWebContents(); |
| 1150 ASSERT_TRUE(contents); |
| 1151 |
| 1152 ChromeSecurityStateModelClient* model_client = |
| 1153 ChromeSecurityStateModelClient::FromWebContents(contents); |
| 1154 ASSERT_TRUE(model_client); |
| 1140 | 1155 |
| 1141 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); | 1156 ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
| 1142 EXPECT_EQ(security_state::SecurityStateModel::NONE, | 1157 EXPECT_EQ(security_state::SecurityStateModel::NONE, |
| 1143 model_client->GetSecurityInfo().security_level); | 1158 model_client->GetSecurityInfo().security_level); |
| 1159 } |
| 1160 |
| 1161 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkDataAsNonSecure) { |
| 1162 scoped_refptr<base::FieldTrial> trial = |
| 1163 base::FieldTrialList::CreateFieldTrial( |
| 1164 "MarkNonSecureAs", |
| 1165 security_state::switches::kMarkNonSecureAsNonSecure); |
| 1166 |
| 1167 content::WebContents* contents = |
| 1168 browser()->tab_strip_model()->GetActiveWebContents(); |
| 1169 ASSERT_TRUE(contents); |
| 1170 |
| 1171 ChromeSecurityStateModelClient* model_client = |
| 1172 ChromeSecurityStateModelClient::FromWebContents(contents); |
| 1173 ASSERT_TRUE(model_client); |
| 1144 | 1174 |
| 1145 ui_test_utils::NavigateToURL(browser(), GURL("data:text/plain,hello")); | 1175 ui_test_utils::NavigateToURL(browser(), GURL("data:text/plain,hello")); |
| 1146 EXPECT_EQ(security_state::SecurityStateModel::NONE, | 1176 EXPECT_EQ(security_state::SecurityStateModel::NONE, |
| 1147 model_client->GetSecurityInfo().security_level); | 1177 model_client->GetSecurityInfo().security_level); |
| 1178 } |
| 1179 |
| 1180 IN_PROC_BROWSER_TEST_F(SSLUITest, MarkBlobAsNonSecure) { |
| 1181 scoped_refptr<base::FieldTrial> trial = |
| 1182 base::FieldTrialList::CreateFieldTrial( |
| 1183 "MarkNonSecureAs", |
| 1184 security_state::switches::kMarkNonSecureAsNonSecure); |
| 1185 |
| 1186 content::WebContents* contents = |
| 1187 browser()->tab_strip_model()->GetActiveWebContents(); |
| 1188 ASSERT_TRUE(contents); |
| 1189 |
| 1190 ChromeSecurityStateModelClient* model_client = |
| 1191 ChromeSecurityStateModelClient::FromWebContents(contents); |
| 1192 ASSERT_TRUE(model_client); |
| 1148 | 1193 |
| 1149 ui_test_utils::NavigateToURL( | 1194 ui_test_utils::NavigateToURL( |
| 1150 browser(), | 1195 browser(), |
| 1151 GURL("blob:chrome%3A//newtab/49a463bb-fac8-476c-97bf-5d7076c3ea1a")); | 1196 GURL("blob:chrome%3A//newtab/49a463bb-fac8-476c-97bf-5d7076c3ea1a")); |
| 1152 EXPECT_EQ(security_state::SecurityStateModel::NONE, | 1197 EXPECT_EQ(security_state::SecurityStateModel::NONE, |
| 1153 model_client->GetSecurityInfo().security_level); | 1198 model_client->GetSecurityInfo().security_level); |
| 1154 } | 1199 } |
| 1155 | 1200 |
| 1156 #if defined(USE_NSS_CERTS) | 1201 #if defined(USE_NSS_CERTS) |
| 1157 class SSLUITestWithClientCert : public SSLUITest { | 1202 class SSLUITestWithClientCert : public SSLUITest { |
| (...skipping 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2931 | 2976 |
| 2932 // Visit a page over https that contains a frame with a redirect. | 2977 // Visit a page over https that contains a frame with a redirect. |
| 2933 | 2978 |
| 2934 // XMLHttpRequest insecure content in synchronous mode. | 2979 // XMLHttpRequest insecure content in synchronous mode. |
| 2935 | 2980 |
| 2936 // XMLHttpRequest insecure content in asynchronous mode. | 2981 // XMLHttpRequest insecure content in asynchronous mode. |
| 2937 | 2982 |
| 2938 // XMLHttpRequest over bad ssl in synchronous mode. | 2983 // XMLHttpRequest over bad ssl in synchronous mode. |
| 2939 | 2984 |
| 2940 // XMLHttpRequest over OK ssl in synchronous mode. | 2985 // XMLHttpRequest over OK ssl in synchronous mode. |
| OLD | NEW |