| Index: chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
|
| ===================================================================
|
| --- chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc (revision 7499)
|
| +++ chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc (working copy)
|
| @@ -89,12 +89,15 @@
|
| // Test for bug #1091358.
|
| TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest) {
|
| const wchar_t kDocRoot[] = L"chrome/test/data";
|
| - TestServer server(kDocRoot);
|
| + scoped_refptr<HTTPTestServer> server =
|
| + HTTPTestServer::CreateServer(kDocRoot);
|
| + 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.html"));
|
| + tab->NavigateToURL(server->TestServerPageW(
|
| + L"files/sync_xmlhttprequest.html"));
|
|
|
| // Let's check the XMLHttpRequest ran successfully.
|
| bool success = false;
|
| @@ -109,14 +112,16 @@
|
| // if executed while navigating to a new page.
|
| TEST_F(ResourceDispatcherTest, SyncXMLHttpRequestDuringUnload) {
|
| const wchar_t kDocRoot[] = L"chrome/test/data";
|
| - TestServer server(kDocRoot);
|
| + scoped_refptr<HTTPTestServer> server =
|
| + HTTPTestServer::CreateServer(kDocRoot);
|
| + 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_during_unload.html"));
|
| + server->TestServerPageW(L"files/sync_xmlhttprequest_during_unload.html"));
|
|
|
| // Confirm that the page has loaded (since it changes its title during load).
|
| std::wstring tab_title;
|
| @@ -126,7 +131,7 @@
|
| // Navigate to a new page, to dispatch unload event and trigger xhr.
|
| // (the bug would make this step hang the renderer).
|
| bool timed_out = false;
|
| - tab->NavigateToURLWithTimeout(server.TestServerPageW(L"files/title2.html"),
|
| + tab->NavigateToURLWithTimeout(server->TestServerPageW(L"files/title2.html"),
|
| kWaitForActionMaxMsec,
|
| &timed_out);
|
| EXPECT_FALSE(timed_out);
|
| @@ -142,13 +147,15 @@
|
| // Tests that onunload is run for cross-site requests. (Bug 1114994)
|
| TEST_F(ResourceDispatcherTest, CrossSiteOnunloadCookie) {
|
| const wchar_t kDocRoot[] = L"chrome/test/data";
|
| - TestServer server(kDocRoot);
|
| + scoped_refptr<HTTPTestServer> server =
|
| + HTTPTestServer::CreateServer(kDocRoot);
|
| + 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());
|
|
|
| - GURL url(server.TestServerPageW(L"files/onunload_cookie.html"));
|
| + GURL url(server->TestServerPageW(L"files/onunload_cookie.html"));
|
| tab->NavigateToURL(url);
|
|
|
| // Confirm that the page has loaded (since it changes its title during load).
|
| @@ -219,13 +226,15 @@
|
| // away from the link doctor page. (Bug 1235537)
|
| TEST_F(ResourceDispatcherTest, CrossSiteNavigationErrorPage) {
|
| const wchar_t kDocRoot[] = L"chrome/test/data";
|
| - TestServer server(kDocRoot);
|
| + scoped_refptr<HTTPTestServer> server =
|
| + HTTPTestServer::CreateServer(kDocRoot);
|
| + 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());
|
|
|
| - GURL url(server.TestServerPageW(L"files/onunload_cookie.html"));
|
| + GURL url(server->TestServerPageW(L"files/onunload_cookie.html"));
|
| tab->NavigateToURL(url);
|
|
|
| // Confirm that the page has loaded (since it changes its title during load).
|
| @@ -259,7 +268,7 @@
|
| // WebContents was in the NORMAL state, it would ignore the attempt to run
|
| // the onunload handler, and the navigation would fail.
|
| // (Test by redirecting to javascript:window.location='someURL'.)
|
| - GURL test_url(server.TestServerPageW(L"files/title2.html"));
|
| + GURL test_url(server->TestServerPageW(L"files/title2.html"));
|
| std::wstring redirect_url = L"javascript:window.location='" +
|
| ASCIIToWide(test_url.possibly_invalid_spec()) + L"'";
|
| tab->NavigateToURLAsync(GURL(redirect_url));
|
|
|