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

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

Issue 2974553002: Fix NavigationHandle being thrown out and recreated (without all the state) after rapid navigations. (Closed)
Patch Set: fix Created 3 years, 5 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
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 8a3af9f15a77954d6fa9c5a5eb845c2af2502ad9..2ff8762587113f3eaa1ea6ef7d42301c0e02d629 100644
--- a/chrome/browser/ssl/ssl_browser_tests.cc
+++ b/chrome/browser/ssl/ssl_browser_tests.cc
@@ -4352,6 +4352,34 @@ IN_PROC_BROWSER_TEST_F(SSLUITest,
CheckAuthenticatedState(tab, AuthState::NONE);
}
+// Checks that a restore followed immediately by a history navigation doesn't
+// lose SSL state.
+IN_PROC_BROWSER_TEST_F(SSLUITest, RestoreThenNavigateHasSSLState) {
+ // This race condition only happens with PlzNavigate.
+ if (!content::IsBrowserSideNavigationEnabled())
+ return;
+ ASSERT_TRUE(https_server_.Start());
+ GURL url1(https_server_.GetURL("/ssl/google.html"));
+ GURL url2(https_server_.GetURL("/ssl/page_with_refs.html"));
+ ui_test_utils::NavigateToURLWithDisposition(
+ browser(), url1, WindowOpenDisposition::NEW_FOREGROUND_TAB,
+ ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
+ ui_test_utils::NavigateToURL(browser(), url2);
+ chrome::CloseTab(browser());
+
+ content::WindowedNotificationObserver tab_added_observer(
+ chrome::NOTIFICATION_TAB_PARENTED,
+ content::NotificationService::AllSources());
+ chrome::RestoreTab(browser());
+ tab_added_observer.Wait();
+
+ WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
+ content::TestNavigationManager observer(tab, url1);
+ chrome::GoBack(browser(), WindowOpenDisposition::CURRENT_TAB);
+ observer.WaitForNavigationFinished();
+ CheckAuthenticatedState(tab, AuthState::NONE);
+}
+
// Simulate the URL changing when the user presses enter in the omnibox. This
// could happen when the user's login is expired and the server redirects them
// to a login page. This will be considered a SAME_PAGE navigation but we do
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_controller_impl.cc » ('j') | content/renderer/render_frame_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698