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

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

Issue 56016: Fix renderer hang caused when a synchronous XHR is disallowed for security... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 9 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
Index: chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
===================================================================
--- chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc (revision 12654)
+++ chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc (working copy)
@@ -107,10 +107,30 @@
EXPECT_TRUE(success);
}
+TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest_Disallowed) {
+ const wchar_t kDocRoot[] = L"chrome/test/data";
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateServer(kDocRoot, NULL);
+ ASSERT_TRUE(NULL != server.get());
+
+ scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0));
+ EXPECT_TRUE(browser_proxy.get());
+ scoped_ptr<TabProxy> tab(browser_proxy->GetActiveTab());
+ tab->NavigateToURL(server->TestServerPageW(
+ L"files/sync_xmlhttprequest_disallowed.html"));
+
+ // Let's check the XMLHttpRequest ran successfully.
+ bool success = false;
+ EXPECT_TRUE(tab->ExecuteAndExtractBool(L"",
+ L"window.domAutomationController.send(DidSucceed());",
+ &success));
+ EXPECT_TRUE(success);
+}
+
// Test for bug #1159553 -- A synchronous xhr (whose content-type is
// downloadable) would trigger download and hang the renderer process,
// if executed while navigating to a new page.
-TEST_F(ResourceDispatcherTest, SyncXMLHttpRequestDuringUnload) {
+TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest_DuringUnload) {
const wchar_t kDocRoot[] = L"chrome/test/data";
scoped_refptr<HTTPTestServer> server =
HTTPTestServer::CreateServer(kDocRoot, NULL);
« no previous file with comments | « chrome/browser/renderer_host/resource_dispatcher_host.cc ('k') | chrome/browser/renderer_host/resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698