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 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 IN_PROC_BROWSER_TEST_F(SSLUITest, | 921 IN_PROC_BROWSER_TEST_F(SSLUITest, |
922 TestHTTPSExpiredCertAndGoBackViaButton) { | 922 TestHTTPSExpiredCertAndGoBackViaButton) { |
923 ASSERT_TRUE(embedded_test_server()->Start()); | 923 ASSERT_TRUE(embedded_test_server()->Start()); |
924 ASSERT_TRUE(https_server_expired_.Start()); | 924 ASSERT_TRUE(https_server_expired_.Start()); |
925 | 925 |
926 // First navigate to an HTTP page. | 926 // First navigate to an HTTP page. |
927 ui_test_utils::NavigateToURL( | 927 ui_test_utils::NavigateToURL( |
928 browser(), embedded_test_server()->GetURL("/ssl/google.html")); | 928 browser(), embedded_test_server()->GetURL("/ssl/google.html")); |
929 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); | 929 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); |
930 NavigationEntry* entry = tab->GetController().GetActiveEntry(); | 930 NavigationEntry* entry = tab->GetController().GetActiveEntry(); |
| 931 content::RenderFrameHost* rfh = tab->GetMainFrame(); |
931 ASSERT_TRUE(entry); | 932 ASSERT_TRUE(entry); |
932 | 933 |
933 // Now go to a bad HTTPS page that shows an interstitial. | 934 // Now go to a bad HTTPS page that shows an interstitial. |
934 ui_test_utils::NavigateToURL( | 935 ui_test_utils::NavigateToURL( |
935 browser(), https_server_expired_.GetURL("/ssl/google.html")); | 936 browser(), https_server_expired_.GetURL("/ssl/google.html")); |
936 CheckAuthenticationBrokenState( | 937 CheckAuthenticationBrokenState( |
937 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL); | 938 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL); |
938 | 939 |
939 ProvisionalLoadWaiter load_failed_observer(tab); | 940 ProvisionalLoadWaiter load_failed_observer(tab); |
940 | 941 |
941 // Simulate user clicking on back button (crbug.com/39248). | 942 // Simulate user clicking on back button (crbug.com/39248). |
942 chrome::GoBack(browser(), CURRENT_TAB); | 943 chrome::GoBack(browser(), CURRENT_TAB); |
943 | 944 |
944 // Wait until we hear the load failure, and make sure we haven't swapped out | 945 // Wait until we hear the load failure, and make sure we haven't changed |
945 // the previous page. Prevents regression of http://crbug.com/82667. | 946 // the previous RFH. Prevents regression of http://crbug.com/82667. |
946 // TODO(creis/nick): Move the swapped-out part of this test into content | |
947 // and remove IsRenderViewHostSwappedOut from the public API. | |
948 load_failed_observer.Wait(); | 947 load_failed_observer.Wait(); |
949 EXPECT_FALSE(content::RenderFrameHostTester::IsRenderFrameHostSwappedOut( | 948 EXPECT_EQ(rfh, tab->GetMainFrame()); |
950 tab->GetMainFrame())); | |
951 | 949 |
952 // We should be back at the original good page. | 950 // We should be back at the original good page. |
953 EXPECT_FALSE(browser()->tab_strip_model()->GetActiveWebContents()-> | 951 EXPECT_FALSE(browser()->tab_strip_model()->GetActiveWebContents()-> |
954 GetInterstitialPage()); | 952 GetInterstitialPage()); |
955 CheckUnauthenticatedState(tab, AuthState::NONE); | 953 CheckUnauthenticatedState(tab, AuthState::NONE); |
956 } | 954 } |
957 | 955 |
958 // Visits a page with https error and then goes back using GoToOffset. | 956 // Visits a page with https error and then goes back using GoToOffset. |
959 // Disabled because its flaky: http://crbug.com/40932, http://crbug.com/43575. | 957 // Disabled because its flaky: http://crbug.com/40932, http://crbug.com/43575. |
960 IN_PROC_BROWSER_TEST_F(SSLUITest, | 958 IN_PROC_BROWSER_TEST_F(SSLUITest, |
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2976 | 2974 |
2977 // Visit a page over https that contains a frame with a redirect. | 2975 // Visit a page over https that contains a frame with a redirect. |
2978 | 2976 |
2979 // XMLHttpRequest insecure content in synchronous mode. | 2977 // XMLHttpRequest insecure content in synchronous mode. |
2980 | 2978 |
2981 // XMLHttpRequest insecure content in asynchronous mode. | 2979 // XMLHttpRequest insecure content in asynchronous mode. |
2982 | 2980 |
2983 // XMLHttpRequest over bad ssl in synchronous mode. | 2981 // XMLHttpRequest over bad ssl in synchronous mode. |
2984 | 2982 |
2985 // XMLHttpRequest over OK ssl in synchronous mode. | 2983 // XMLHttpRequest over OK ssl in synchronous mode. |
OLD | NEW |