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

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

Issue 2280753003: Clear |displayed_content_with_cert_errors_| on navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | chrome/test/data/ssl/page_with_subresource.html » ('j') | 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 28422f9292bd98df5fc05c047a0c269f1bf3bbb2..171f8316902d383445eacb91c8988c8ebafbf277 100644
--- a/chrome/browser/ssl/ssl_browser_tests.cc
+++ b/chrome/browser/ssl/ssl_browser_tests.cc
@@ -763,6 +763,39 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestBrokenHTTPSWithActiveInsecureContent) {
AuthState::RAN_INSECURE_CONTENT);
}
+// Tests that the WebContents's flag for displaying content with cert
+// errors get cleared upon navigation.
+IN_PROC_BROWSER_TEST_F(SSLUITest,
+ DisplayedContentWithCertErrorsClearedOnNavigation) {
+ ASSERT_TRUE(https_server_.Start());
+ ASSERT_TRUE(https_server_expired_.Start());
+
+ WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
+ ASSERT_TRUE(tab);
+
+ // Navigate to a page with a certificate error and click through the
+ // interstitial.
+ ui_test_utils::NavigateToURL(
+ browser(),
+ https_server_expired_.GetURL("/ssl/page_with_subresource.html"));
+ CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID,
+ AuthState::SHOWING_INTERSTITIAL);
+ ProceedThroughInterstitial(tab);
+
+ NavigationEntry* entry = tab->GetController().GetVisibleEntry();
+ ASSERT_TRUE(entry);
+ EXPECT_TRUE(entry->GetSSL().content_status &
+ content::SSLStatus::DISPLAYED_CONTENT_WITH_CERT_ERRORS);
+
+ // Navigate away to a different page, and check that the flag gets cleared.
+ ui_test_utils::NavigateToURL(browser(),
+ https_server_.GetURL("/ssl/google.html"));
+ entry = tab->GetController().GetVisibleEntry();
+ ASSERT_TRUE(entry);
+ EXPECT_FALSE(entry->GetSSL().content_status &
+ content::SSLStatus::DISPLAYED_CONTENT_WITH_CERT_ERRORS);
+}
+
IN_PROC_BROWSER_TEST_F(SSLUITest, TestBrokenHTTPSMetricsReporting_Proceed) {
ASSERT_TRUE(https_server_expired_.Start());
ASSERT_NO_FATAL_FAILURE(SetUpMockReporter());
« no previous file with comments | « no previous file | chrome/test/data/ssl/page_with_subresource.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698