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

Unified Diff: chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc

Issue 2860030: Fixes a DCHECK when visiting chrome://theme.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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/renderer_host/resource_dispatcher_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
===================================================================
--- chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc (revision 50939)
+++ chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc (working copy)
@@ -317,4 +317,27 @@
L"Title Of More Awesomeness", 2);
}
+// Tests that ResourceDispatcherHostRequestInfo is updated correctly on failed
+// requests, to prevent calling Read on a request that has already failed.
+// See bug 40250.
+TEST_F(ResourceDispatcherTest, CrossSiteFailedRequest) {
+ scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0));
+ ASSERT_TRUE(browser_proxy.get());
+ scoped_refptr<TabProxy> tab(browser_proxy->GetActiveTab());
+ ASSERT_TRUE(tab.get());
+
+ // Visit another URL first to trigger a cross-site navigation.
+ GURL url(chrome::kChromeUINewTabURL);
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(url));
+
+ // Visit a URL that fails without calling ResourceDispatcherHost::Read.
+ GURL broken_url("chrome://theme");
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab->NavigateToURL(broken_url));
+
+ // Make sure the navigation finishes.
+ std::wstring tab_title;
+ EXPECT_TRUE(tab->GetTabTitle(&tab_title));
+ EXPECT_EQ(L"chrome://theme/ is not available", tab_title);
+}
+
} // namespace
« no previous file with comments | « chrome/browser/renderer_host/resource_dispatcher_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698