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

Side by Side 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, 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/data/ssl/page_with_subresource.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 https_server_expired_.GetURL("/ssl/page_runs_insecure_content.html")); 756 https_server_expired_.GetURL("/ssl/page_runs_insecure_content.html"));
757 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, 757 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID,
758 AuthState::SHOWING_INTERSTITIAL); 758 AuthState::SHOWING_INTERSTITIAL);
759 ProceedThroughInterstitial(tab); 759 ProceedThroughInterstitial(tab);
760 760
761 // Now check that the page is marked as having run insecure content. 761 // Now check that the page is marked as having run insecure content.
762 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID, 762 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID,
763 AuthState::RAN_INSECURE_CONTENT); 763 AuthState::RAN_INSECURE_CONTENT);
764 } 764 }
765 765
766 // Tests that the WebContents's flag for displaying content with cert
767 // errors get cleared upon navigation.
768 IN_PROC_BROWSER_TEST_F(SSLUITest,
769 DisplayedContentWithCertErrorsClearedOnNavigation) {
770 ASSERT_TRUE(https_server_.Start());
771 ASSERT_TRUE(https_server_expired_.Start());
772
773 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
774 ASSERT_TRUE(tab);
775
776 // Navigate to a page with a certificate error and click through the
777 // interstitial.
778 ui_test_utils::NavigateToURL(
779 browser(),
780 https_server_expired_.GetURL("/ssl/page_with_subresource.html"));
781 CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID,
782 AuthState::SHOWING_INTERSTITIAL);
783 ProceedThroughInterstitial(tab);
784
785 NavigationEntry* entry = tab->GetController().GetVisibleEntry();
786 ASSERT_TRUE(entry);
787 EXPECT_TRUE(entry->GetSSL().content_status &
788 content::SSLStatus::DISPLAYED_CONTENT_WITH_CERT_ERRORS);
789
790 // Navigate away to a different page, and check that the flag gets cleared.
791 ui_test_utils::NavigateToURL(browser(),
792 https_server_.GetURL("/ssl/google.html"));
793 entry = tab->GetController().GetVisibleEntry();
794 ASSERT_TRUE(entry);
795 EXPECT_FALSE(entry->GetSSL().content_status &
796 content::SSLStatus::DISPLAYED_CONTENT_WITH_CERT_ERRORS);
797 }
798
766 IN_PROC_BROWSER_TEST_F(SSLUITest, TestBrokenHTTPSMetricsReporting_Proceed) { 799 IN_PROC_BROWSER_TEST_F(SSLUITest, TestBrokenHTTPSMetricsReporting_Proceed) {
767 ASSERT_TRUE(https_server_expired_.Start()); 800 ASSERT_TRUE(https_server_expired_.Start());
768 ASSERT_NO_FATAL_FAILURE(SetUpMockReporter()); 801 ASSERT_NO_FATAL_FAILURE(SetUpMockReporter());
769 base::HistogramTester histograms; 802 base::HistogramTester histograms;
770 const std::string decision_histogram = 803 const std::string decision_histogram =
771 "interstitial.ssl_overridable.decision"; 804 "interstitial.ssl_overridable.decision";
772 const std::string interaction_histogram = 805 const std::string interaction_histogram =
773 "interstitial.ssl_overridable.interaction"; 806 "interstitial.ssl_overridable.interaction";
774 807
775 // Histograms should start off empty. 808 // Histograms should start off empty.
(...skipping 2320 matching lines...) Expand 10 before | Expand all | Expand 10 after
3096 3129
3097 // Visit a page over https that contains a frame with a redirect. 3130 // Visit a page over https that contains a frame with a redirect.
3098 3131
3099 // XMLHttpRequest insecure content in synchronous mode. 3132 // XMLHttpRequest insecure content in synchronous mode.
3100 3133
3101 // XMLHttpRequest insecure content in asynchronous mode. 3134 // XMLHttpRequest insecure content in asynchronous mode.
3102 3135
3103 // XMLHttpRequest over bad ssl in synchronous mode. 3136 // XMLHttpRequest over bad ssl in synchronous mode.
3104 3137
3105 // XMLHttpRequest over OK ssl in synchronous mode. 3138 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« 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