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

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

Issue 2337793002: Fix SSLUITest.TestGoodFrameNavigation with PlzNavigate. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_browser_tests.cc
diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc
index 1fa54ffa1a0e9572bc373ee1a2ffb73063f5f67e..1a13c61a6f28c23ff8ffd76ca0ddfb3b7d415335 100644
--- a/chrome/browser/ssl/ssl_browser_tests.cc
+++ b/chrome/browser/ssl/ssl_browser_tests.cc
@@ -2116,6 +2116,15 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) {
ASSERT_TRUE(https_server_.Start());
ASSERT_TRUE(https_server_expired_.Start());
+ // Make sure to add this hostname to the resolver so that it's not blocked
+ // (browser_test_base.cc has a resolver that blocks all non-local hostnames
+ // by default to ensure tests don't hit the network). This is critical to do
+ // because for PlzNavigate the request would otherwise get cancelled in the
+ // browser before the renderer sees it.
+ host_resolver()->AddRule(
+ "example.test",
+ embedded_test_server()->GetURL("/title1.html").host());
+
std::string top_frame_path;
GetTopFramePath(*embedded_test_server(), https_server_, https_server_expired_,
&top_frame_path);
@@ -2193,11 +2202,12 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) {
observer.Wait();
}
- // Our state should be unathenticated (in the ran mixed script sense)
+ // Our state should be unathenticated (in the ran mixed script sense). Note
+ // this also displayed images from the http page (google.com).
scottmg 2016/09/12 23:13:30 displayed -> displays
jam 2016/09/12 23:21:54 Done.
CheckAuthenticationBrokenState(
tab,
CertError::NONE,
- AuthState::RAN_INSECURE_CONTENT);
+ AuthState::RAN_INSECURE_CONTENT | AuthState::DISPLAYED_INSECURE_CONTENT);
// Go back, our state should be unchanged.
{
@@ -2211,7 +2221,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestGoodFrameNavigation) {
CheckAuthenticationBrokenState(
tab,
CertError::NONE,
- AuthState::RAN_INSECURE_CONTENT);
+ AuthState::RAN_INSECURE_CONTENT | AuthState::DISPLAYED_INSECURE_CONTENT);
}
// From a bad HTTPS top frame:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698