OLD | NEW |
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 Loading... |
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 Loading... |
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. |
OLD | NEW |