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

Side by Side Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 1799163002: Remove swapped out state from RenderFrameHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing failing layout test and adding an explicit test. Created 4 years, 9 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
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 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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.
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl.cc » ('j') | content/browser/frame_host/render_frame_host_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698