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

Unified Diff: chrome/browser/ssl/chrome_security_state_model_client_browser_tests.cc

Issue 1931063004: Stop blocking 'http://127.0.0.1/' as mixed content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ugh. Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ssl/chrome_security_state_model_client_browser_tests.cc
diff --git a/chrome/browser/ssl/chrome_security_state_model_client_browser_tests.cc b/chrome/browser/ssl/chrome_security_state_model_client_browser_tests.cc
index 8eb3ba3bb1aeecc9225d8588f03dddb8425e1529..ffcfc3b0b3209dc30218c6fe1c99398733898c50 100644
--- a/chrome/browser/ssl/chrome_security_state_model_client_browser_tests.cc
+++ b/chrome/browser/ssl/chrome_security_state_model_client_browser_tests.cc
@@ -341,12 +341,17 @@ IN_PROC_BROWSER_TEST_F(ChromeSecurityStateModelClientTest, MixedContent) {
ASSERT_TRUE(embedded_test_server()->Start());
ASSERT_TRUE(https_server_.Start());
SetUpMockCertVerifierForHttpsServer(0, net::OK);
+ host_resolver()->AddRule("example.test",
+ https_server_.GetURL("/").host());
+
+ net::HostPortPair replacement_pair = embedded_test_server()->host_port_pair();
+ replacement_pair.set_host("example.test");
// Navigate to an HTTPS page that displays mixed content.
std::string replacement_path;
GetFilePathWithHostAndPortReplacement(
"/ssl/page_displays_insecure_content.html",
- embedded_test_server()->host_port_pair(), &replacement_path);
+ replacement_pair, &replacement_path);
ui_test_utils::NavigateToURL(browser(),
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
@@ -358,7 +363,7 @@ IN_PROC_BROWSER_TEST_F(ChromeSecurityStateModelClientTest, MixedContent) {
// Navigate to an HTTPS page that displays mixed content dynamically.
GetFilePathWithHostAndPortReplacement(
"/ssl/page_with_dynamic_insecure_content.html",
- embedded_test_server()->host_port_pair(), &replacement_path);
+ replacement_pair, &replacement_path);
ui_test_utils::NavigateToURL(browser(),
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
@@ -381,7 +386,7 @@ IN_PROC_BROWSER_TEST_F(ChromeSecurityStateModelClientTest, MixedContent) {
// Navigate to an HTTPS page that runs mixed content.
GetFilePathWithHostAndPortReplacement(
"/ssl/page_runs_insecure_content.html",
- embedded_test_server()->host_port_pair(), &replacement_path);
+ replacement_pair, &replacement_path);
ui_test_utils::NavigateToURL(browser(),
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
@@ -394,7 +399,7 @@ IN_PROC_BROWSER_TEST_F(ChromeSecurityStateModelClientTest, MixedContent) {
// Navigate to an HTTPS page that runs and displays mixed content.
GetFilePathWithHostAndPortReplacement(
"/ssl/page_runs_and_displays_insecure_content.html",
- embedded_test_server()->host_port_pair(), &replacement_path);
+ replacement_pair, &replacement_path);
ui_test_utils::NavigateToURL(browser(),
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
@@ -436,11 +441,17 @@ IN_PROC_BROWSER_TEST_F(ChromeSecurityStateModelClientTest,
SetUpMockCertVerifierForHttpsServer(net::CERT_STATUS_SHA1_SIGNATURE_PRESENT,
net::OK);
+ host_resolver()->AddRule("example.test",
+ https_server_.GetURL("/").host());
+
+ net::HostPortPair replacement_pair = embedded_test_server()->host_port_pair();
+ replacement_pair.set_host("example.test");
+
// Navigate to an HTTPS page that displays mixed content.
std::string replacement_path;
GetFilePathWithHostAndPortReplacement(
"/ssl/page_displays_insecure_content.html",
- embedded_test_server()->host_port_pair(), &replacement_path);
+ replacement_pair, &replacement_path);
ui_test_utils::NavigateToURL(browser(),
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
@@ -453,7 +464,7 @@ IN_PROC_BROWSER_TEST_F(ChromeSecurityStateModelClientTest,
// Navigate to an HTTPS page that displays mixed content dynamically.
GetFilePathWithHostAndPortReplacement(
"/ssl/page_with_dynamic_insecure_content.html",
- embedded_test_server()->host_port_pair(), &replacement_path);
+ replacement_pair, &replacement_path);
ui_test_utils::NavigateToURL(browser(),
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
@@ -478,7 +489,7 @@ IN_PROC_BROWSER_TEST_F(ChromeSecurityStateModelClientTest,
// Navigate to an HTTPS page that runs mixed content.
GetFilePathWithHostAndPortReplacement(
"/ssl/page_runs_insecure_content.html",
- embedded_test_server()->host_port_pair(), &replacement_path);
+ replacement_pair, &replacement_path);
ui_test_utils::NavigateToURL(browser(),
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
@@ -491,7 +502,7 @@ IN_PROC_BROWSER_TEST_F(ChromeSecurityStateModelClientTest,
// Navigate to an HTTPS page that runs and displays mixed content.
GetFilePathWithHostAndPortReplacement(
"/ssl/page_runs_and_displays_insecure_content.html",
- embedded_test_server()->host_port_pair(), &replacement_path);
+ replacement_pair, &replacement_path);
ui_test_utils::NavigateToURL(browser(),
https_server_.GetURL(replacement_path));
CheckSecurityInfoForSecure(
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | chrome/test/data/ssl/page_displays_insecure_content.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698