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

Unified Diff: chrome/browser/ssl_uitest.cc

Issue 1898: Fix crasher when closing tab with bad SSL constrained popup (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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
« no previous file with comments | « chrome/browser/ssl_blocking_page.cc ('k') | chrome/test/data/ssl/page_with_unsafe_popup.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl_uitest.cc
===================================================================
--- chrome/browser/ssl_uitest.cc (revision 1864)
+++ chrome/browser/ssl_uitest.cc (working copy)
@@ -123,13 +123,13 @@
// Visits a page over http which includes broken https resources (status should
// be OK).
TEST_F(SSLUITest, TestHTTPWithBrokenHTTPSResource) {
- TestServer httpServer(kDocRoot);
+ TestServer http_server(kDocRoot);
HTTPSTestServer httpsServer(kHostName, kBadHTTPSPort,
kDocRoot, GetExpiredCertPath());
scoped_ptr<TabProxy> tab(GetActiveTabProxy());
NavigateTab(tab.get(),
- httpServer.TestServerPageW(L"files/ssl/page_with_unsafe_contents.html"));
+ http_server.TestServerPageW(L"files/ssl/page_with_unsafe_contents.html"));
SecurityStyle security_style;
int cert_status;
@@ -470,6 +470,33 @@
EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state);
}
+// Tests that closing a page that has a unsafe pop-up does not crash the browser
+// (bug #1966).
+TEST_F(SSLUITest, TestCloseTabWithUnsafePopup) {
+ TestServer http_server(kDocRoot);
+ HTTPSTestServer bad_https_server(kHostName, kBadHTTPSPort,
+ kDocRoot, GetExpiredCertPath());
+
+ scoped_ptr<TabProxy> tab(GetActiveTabProxy());
+ NavigateTab(tab.get(),
+ http_server.TestServerPageW(
+ L"files/ssl/page_with_unsafe_popup.html"));
+
+ int popup_count = 0;
+ EXPECT_TRUE(tab->GetConstrainedWindowCount(&popup_count));
+ EXPECT_EQ(1, popup_count);
+
+ // Let's add another tab to make sure the browser does not exit when we close
+ // the first tab.
+ scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0));
+ EXPECT_TRUE(browser_proxy.get());
+ browser_proxy->AppendTab(
+ http_server.TestServerPageW(L"files/ssl/google.html"));
+
+ // Close the first tab.
+ tab->Close();
+}
+
// TODO (jcampan): more tests to do below.
// Visit a page over bad https that is a redirect to a page with good https.
« no previous file with comments | « chrome/browser/ssl_blocking_page.cc ('k') | chrome/test/data/ssl/page_with_unsafe_popup.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698