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/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 Loading... |
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 IN_PROC_BROWSER_TEST_F(SSLUITest, RestoreThenNavigateHasSSLState) { |
| 4358 // This race condition only happens with PlzNavigate. |
| 4359 if (!content::IsBrowserSideNavigationEnabled()) |
| 4360 return; |
| 4361 ASSERT_TRUE(https_server_.Start()); |
| 4362 GURL url1(https_server_.GetURL("/ssl/google.html")); |
| 4363 GURL url2(https_server_.GetURL("/ssl/page_with_refs.html")); |
| 4364 ui_test_utils::NavigateToURLWithDisposition( |
| 4365 browser(), url1, WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 4366 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 4367 ui_test_utils::NavigateToURL(browser(), url2); |
| 4368 chrome::CloseTab(browser()); |
| 4369 |
| 4370 content::WindowedNotificationObserver tab_added_observer( |
| 4371 chrome::NOTIFICATION_TAB_PARENTED, |
| 4372 content::NotificationService::AllSources()); |
| 4373 chrome::RestoreTab(browser()); |
| 4374 tab_added_observer.Wait(); |
| 4375 |
| 4376 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); |
| 4377 content::TestNavigationManager observer(tab, url1); |
| 4378 chrome::GoBack(browser(), WindowOpenDisposition::CURRENT_TAB); |
| 4379 observer.WaitForNavigationFinished(); |
| 4380 CheckAuthenticatedState(tab, AuthState::NONE); |
| 4381 } |
| 4382 |
4355 // Simulate the URL changing when the user presses enter in the omnibox. This | 4383 // 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 | 4384 // 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 | 4385 // to a login page. This will be considered a SAME_PAGE navigation but we do |
4358 // want to update the SSL state. | 4386 // want to update the SSL state. |
4359 IN_PROC_BROWSER_TEST_F(SSLUITest, SamePageHasSSLState) { | 4387 IN_PROC_BROWSER_TEST_F(SSLUITest, SamePageHasSSLState) { |
4360 ASSERT_TRUE(embedded_test_server()->Start()); | 4388 ASSERT_TRUE(embedded_test_server()->Start()); |
4361 ASSERT_TRUE(https_server_.Start()); | 4389 ASSERT_TRUE(https_server_.Start()); |
4362 | 4390 |
4363 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); | 4391 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents(); |
4364 | 4392 |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5114 | 5142 |
5115 // Visit a page over https that contains a frame with a redirect. | 5143 // Visit a page over https that contains a frame with a redirect. |
5116 | 5144 |
5117 // XMLHttpRequest insecure content in synchronous mode. | 5145 // XMLHttpRequest insecure content in synchronous mode. |
5118 | 5146 |
5119 // XMLHttpRequest insecure content in asynchronous mode. | 5147 // XMLHttpRequest insecure content in asynchronous mode. |
5120 | 5148 |
5121 // XMLHttpRequest over bad ssl in synchronous mode. | 5149 // XMLHttpRequest over bad ssl in synchronous mode. |
5122 | 5150 |
5123 // XMLHttpRequest over OK ssl in synchronous mode. | 5151 // XMLHttpRequest over OK ssl in synchronous mode. |
OLD | NEW |