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

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

Issue 2851103002: Update some host_resolver()->AddRules in chrome/browser. (Closed)
Patch Set: fix Created 3 years, 8 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/security_state_tab_helper_browser_tests.cc
diff --git a/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc b/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc
index a2aa3be1cdc2e838fa8862184dedb4b5defe9d61..8af6de1cc0d9639a45584a7f3df98f5eabad5e0c 100644
--- a/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc
+++ b/chrome/browser/ssl/security_state_tab_helper_browser_tests.cc
@@ -301,7 +301,7 @@ class SecurityStateTabHelperTest : public CertVerifierBrowserTest {
void SetUpOnMainThread() override {
ASSERT_TRUE(embedded_test_server()->Start());
ASSERT_TRUE(https_server_.Start());
- host_resolver()->AddRule("*", embedded_test_server()->GetURL("/").host());
+ host_resolver()->AddRule("*", "127.0.0.1");
}
void SetUpCommandLine(base::CommandLine* command_line) override {
@@ -384,6 +384,10 @@ class DidChangeVisibleSecurityStateTest : public InProcessBrowserTest {
command_line->AppendSwitch(switches::kAllowRunningInsecureContent);
}
+ void SetUpOnMainThread() override {
+ host_resolver()->AddRule("*", "127.0.0.1");
+ }
+
protected:
net::EmbeddedTestServer https_server_;
@@ -492,8 +496,6 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, SHA1CertificateWarning) {
IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContent) {
SetUpMockCertVerifierForHttpsServer(0, net::OK);
- host_resolver()->AddRule("example.test",
- https_server_.GetURL("/title1.html").host());
net::HostPortPair replacement_pair = embedded_test_server()->host_port_pair();
replacement_pair.set_host("example.test");
@@ -557,11 +559,6 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContent) {
net::HostPortPair host_port_pair =
net::HostPortPair::FromURL(https_server_.GetURL("/title1.html"));
host_port_pair.set_host("different-host.test");
- host_resolver()->AddRule("different-host.test",
- https_server_.GetURL("/title1.html").host());
- host_resolver()->AddRule(
- "different-http-host.test",
- embedded_test_server()->GetURL("/title1.html").host());
GetFilePathWithHostAndPortReplacement(
"/ssl/page_runs_insecure_content_in_iframe.html", host_port_pair,
&replacement_path);
@@ -665,9 +662,6 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContentWithSHA1Cert) {
SetUpMockCertVerifierForHttpsServer(net::CERT_STATUS_SHA1_SIGNATURE_PRESENT,
net::OK);
- host_resolver()->AddRule("example.test",
- https_server_.GetURL("/title1.html").host());
-
net::HostPortPair replacement_pair = embedded_test_server()->host_port_pair();
replacement_pair.set_host("example.test");
@@ -738,8 +732,6 @@ IN_PROC_BROWSER_TEST_F(SecurityStateTabHelperTest, MixedContentStrictBlocking) {
net::HostPortPair host_port_pair =
net::HostPortPair::FromURL(https_server_.GetURL("/title1.html"));
host_port_pair.set_host("different-host.test");
- host_resolver()->AddRule("different-host.test",
- https_server_.GetURL("/title1.html").host());
GetFilePathWithHostAndPortReplacement(
"/ssl/page_runs_insecure_content_in_iframe_with_strict_blocking.html",
host_port_pair, &replacement_path);
@@ -1665,7 +1657,6 @@ IN_PROC_BROWSER_TEST_F(DidChangeVisibleSecurityStateTest,
// Navigate to a bad HTTPS page on a different host, and then click
// Back to verify that the previous good security style is seen again.
GURL expired_https_url(https_test_server_expired.GetURL("/title1.html"));
- host_resolver()->AddRule("www.example_broken.test", "127.0.0.1");
GURL::Replacements replace_host;
replace_host.SetHostStr("www.example_broken.test");
GURL https_url_different_host =
« no previous file with comments | « chrome/browser/search_engines/template_url_scraper_browsertest.cc ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698