summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 19:19:06 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 19:19:06 +0000
commitd497b0781cb67b0d7359a633d88c1ada077992aa (patch)
treea53748014d4d8f9265a5c8e266d0fd4d7639cd0c /chrome/browser/ssl
parent53d1edcbd0c3fc30b5e3af6529a516c41ba8debe (diff)
downloadchromium_src-d497b0781cb67b0d7359a633d88c1ada077992aa.zip
chromium_src-d497b0781cb67b0d7359a633d88c1ada077992aa.tar.gz
chromium_src-d497b0781cb67b0d7359a633d88c1ada077992aa.tar.bz2
Fix a regression appearing in r41875 where navigating back from an interstitial page wouldn't work.
Also, factor out a method WindowDispositionShouldOpenNewTab that's used to decide if a given window disposition opens in a new tab or the current tab. BUG=39248 TEST=SSLUITest.TestHTTPSExpiredCertAndGoBackViaButton, SSLUITest.TestHTTPSExpiredCertAndGoBackViaMenu, manual test: Go to www.google.com, then to https://ebay.com to show the HTTPS interstitial, then navigate back using the toolbar. Review URL: http://codereview.chromium.org/1406001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42974 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ssl')
-rw-r--r--chrome/browser/ssl/ssl_browser_tests.cc30
1 files changed, 29 insertions, 1 deletions
diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc
index c21b481..087d5a9 100644
--- a/chrome/browser/ssl/ssl_browser_tests.cc
+++ b/chrome/browser/ssl/ssl_browser_tests.cc
@@ -220,8 +220,36 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndDontProceed) {
CheckUnauthenticatedState(tab);
}
+// Visits a page with https error and then goes back using Browser::GoBack.
+IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndGoBackViaButton) {
+ scoped_refptr<HTTPTestServer> http_server = PlainServer();
+ ASSERT_TRUE(http_server.get() != NULL);
+ scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer();
+ ASSERT_TRUE(bad_https_server.get() != NULL);
+
+ // First navigate to an HTTP page.
+ ui_test_utils::NavigateToURL(browser(), http_server->TestServerPageW(
+ L"files/ssl/google.html"));
+ TabContents* tab = browser()->GetSelectedTabContents();
+ NavigationEntry* entry = tab->controller().GetActiveEntry();
+ ASSERT_TRUE(entry);
+
+ // Now go to a bad HTTPS page that shows an interstitial.
+ ui_test_utils::NavigateToURL(browser(),
+ bad_https_server->TestServerPageW(L"files/ssl/google.html"));
+ CheckAuthenticationBrokenState(tab, net::CERT_STATUS_DATE_INVALID,
+ true); // Interstitial showing
+
+ // Simulate user clicking on back button (crbug.com/39248).
+ browser()->GoBack(CURRENT_TAB);
+
+ // We should be back at the original good page.
+ EXPECT_FALSE(browser()->GetSelectedTabContents()->interstitial_page());
+ CheckUnauthenticatedState(tab);
+}
+
// Visits a page with https error and then goes back using GoToOffset.
-IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndGoBack) {
+IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndGoBackViaMenu) {
scoped_refptr<HTTPTestServer> http_server = PlainServer();
ASSERT_TRUE(http_server.get() != NULL);
scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer();