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

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

Issue 2976643002: Add a browsertest for the navigation handle getting lost when doing rapid navigations after a ses... (Closed)
Patch Set: disable 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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/base64.h" 7 #include "base/base64.h"
8 #include "base/base_switches.h" 8 #include "base/base_switches.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 4334 matching lines...) Expand 10 before | Expand all | Expand 10 after
4345 CheckAuthenticatedState(tab, AuthState::NONE); 4345 CheckAuthenticatedState(tab, AuthState::NONE);
4346 4346
4347 content::TestNavigationObserver observer(tab); 4347 content::TestNavigationObserver observer(tab);
4348 ASSERT_TRUE(content::ExecuteScript( 4348 ASSERT_TRUE(content::ExecuteScript(
4349 tab, "location.replace(window.location.href + '#1')")); 4349 tab, "location.replace(window.location.href + '#1')"));
4350 observer.Wait(); 4350 observer.Wait();
4351 content::WaitForLoadStop(tab); 4351 content::WaitForLoadStop(tab);
4352 CheckAuthenticatedState(tab, AuthState::NONE); 4352 CheckAuthenticatedState(tab, AuthState::NONE);
4353 } 4353 }
4354 4354
4355 // Checks that a restore followed immediately by a history navigation doesn't
4356 // lose SSL state.
4357 // Disabled since this is a test for bug 738177.
4358 IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_RestoreThenNavigateHasSSLState) {
4359 // This race condition only happens with PlzNavigate.
4360 if (!content::IsBrowserSideNavigationEnabled())
4361 return;
4362 ASSERT_TRUE(https_server_.Start());
4363 GURL url1(https_server_.GetURL("/ssl/google.html"));
4364 GURL url2(https_server_.GetURL("/ssl/page_with_refs.html"));
4365 ui_test_utils::NavigateToURLWithDisposition(
4366 browser(), url1, WindowOpenDisposition::NEW_FOREGROUND_TAB,
4367 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
4368 ui_test_utils::NavigateToURL(browser(), url2);
4369 chrome::CloseTab(browser());
4370
4371 content::WindowedNotificationObserver tab_added_observer(
4372 chrome::NOTIFICATION_TAB_PARENTED,
4373 content::NotificationService::AllSources());
4374 chrome::RestoreTab(browser());
4375 tab_added_observer.Wait();
4376
4377 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
4378 content::TestNavigationManager observer(tab, url1);
4379 chrome::GoBack(browser(), WindowOpenDisposition::CURRENT_TAB);
4380 observer.WaitForNavigationFinished();
4381 CheckAuthenticatedState(tab, AuthState::NONE);
4382 }
4383
4355 // Simulate the URL changing when the user presses enter in the omnibox. This 4384 // Simulate the URL changing when the user presses enter in the omnibox. This
4356 // could happen when the user's login is expired and the server redirects them 4385 // could happen when the user's login is expired and the server redirects them
4357 // to a login page. This will be considered a SAME_PAGE navigation but we do 4386 // to a login page. This will be considered a SAME_PAGE navigation but we do
4358 // want to update the SSL state. 4387 // want to update the SSL state.
4359 IN_PROC_BROWSER_TEST_F(SSLUITest, SamePageHasSSLState) { 4388 IN_PROC_BROWSER_TEST_F(SSLUITest, SamePageHasSSLState) {
4360 ASSERT_TRUE(embedded_test_server()->Start()); 4389 ASSERT_TRUE(embedded_test_server()->Start());
4361 ASSERT_TRUE(https_server_.Start()); 4390 ASSERT_TRUE(https_server_.Start());
4362 4391
4363 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); 4392 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
4364 4393
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
5114 5143
5115 // Visit a page over https that contains a frame with a redirect. 5144 // Visit a page over https that contains a frame with a redirect.
5116 5145
5117 // XMLHttpRequest insecure content in synchronous mode. 5146 // XMLHttpRequest insecure content in synchronous mode.
5118 5147
5119 // XMLHttpRequest insecure content in asynchronous mode. 5148 // XMLHttpRequest insecure content in asynchronous mode.
5120 5149
5121 // XMLHttpRequest over bad ssl in synchronous mode. 5150 // XMLHttpRequest over bad ssl in synchronous mode.
5122 5151
5123 // XMLHttpRequest over OK ssl in synchronous mode. 5152 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698