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

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

Issue 196115: This CL adds a test to insure we are not regressing on http://crbug.com/19941... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « no previous file | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_browser_tests.cc
===================================================================
--- chrome/browser/ssl/ssl_browser_tests.cc (revision 26154)
+++ chrome/browser/ssl/ssl_browser_tests.cc (working copy)
@@ -176,6 +176,43 @@
CheckUnauthenticatedState(tab);
}
+// Open a page with a HTTPS error in a tab with no prior navigation (through a
+// link with a blank target). This is to test that the lack of navigation entry
+// does not cause any problems (it was causing a crasher, see
+// http://crbug.com/19941).
+IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSErrorWithNoNavEntry) {
+ scoped_refptr<HTTPTestServer> http_server = PlainServer();
+ scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer();
+
+ // Load a page with a link that opens a new window (therefore with no history
+ // and no navigation entries).
+ ui_test_utils::NavigateToURL(browser(), http_server->TestServerPageW(
+ L"files/ssl/page_with_blank_target.html"));
+
+ bool success = false;
+ // Simulate clicking the link (and therefore navigating to that new page).
+ // This will causes a new tab to be created.
+ EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
+ browser()->GetSelectedTabContents()->render_view_host(), L"",
+ L"window.domAutomationController.send(navigateInNewTab());",
+ &success));
+ EXPECT_TRUE(success);
+
+ // By the time we got a response, the new tab should have been created and be
+ // the selected tab.
+ EXPECT_EQ(2, browser()->tab_count());
+ EXPECT_EQ(1, browser()->selected_index());
+
+ // Since the navigation was initiated by the renderer (when we clicked on the
+ // link) and since the main page network request failed, we won't get a
+ // navigation entry committed. So we'll just wait for the load to stop.
+ ui_test_utils::WaitForLoadStop(
+ &(browser()->GetSelectedTabContents()->controller()));
+
+ // We should have an interstitial page showing.
+ ASSERT_TRUE(browser()->GetSelectedTabContents()->interstitial_page());
+}
+
//
// Mixed contents
//
« no previous file with comments | « no previous file | chrome/browser/tab_contents/tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698