diff options
22 files changed, 120 insertions, 102 deletions
diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc index dcc00f6..ca68034 100644 --- a/chrome/browser/browser_focus_uitest.cc +++ b/chrome/browser/browser_focus_uitest.cc @@ -56,7 +56,7 @@ bool ActivateTabByClick(AutomationProxy* automation, TEST_F(BrowserFocusTest, BrowsersRememberFocus) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // First we navigate to our test page. @@ -131,7 +131,7 @@ TEST_F(BrowserFocusTest, BrowsersRememberFocus) { // Tabs remember focus. TEST_F(BrowserFocusTest, TabsRememberFocus) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); scoped_ptr<WindowProxy> window(automation()->GetActiveWindow()); @@ -196,7 +196,7 @@ TEST_F(BrowserFocusTest, TabsRememberFocus) { // Background window does not steal focus. TEST_F(BrowserFocusTest, BackgroundBrowserDontStealFocus) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // First we navigate to our test page. @@ -234,7 +234,7 @@ TEST_F(BrowserFocusTest, BackgroundBrowserDontStealFocus) { // Page cannot steal focus when focus is on location bar. TEST_F(BrowserFocusTest, LocationBarLockFocus) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // Open the page that steals focus. @@ -267,7 +267,7 @@ TEST_F(BrowserFocusTest, LocationBarLockFocus) { // Focus traversal TEST_F(BrowserFocusTest, FocusTraversal) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // Open the page the test page. @@ -341,7 +341,7 @@ TEST_F(BrowserFocusTest, FocusTraversal) { // Make sure Find box can request focus, even when it is already open. TEST_F(BrowserFocusTest, FindFocusTest) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // Open some page (any page that doesn't steal focus). diff --git a/chrome/browser/browser_uitest.cc b/chrome/browser/browser_uitest.cc index 40c2c7b..c132e40 100644 --- a/chrome/browser/browser_uitest.cc +++ b/chrome/browser/browser_uitest.cc @@ -154,7 +154,7 @@ TEST_F(BrowserTest, NullOpenerRedirectForksProcess) { const wchar_t kDocRoot[] = L"chrome/test/data"; scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); std::wstring test_file(test_data_directory_); scoped_ptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); @@ -194,7 +194,7 @@ TEST_F(BrowserTest, OtherRedirectsDontForkProcess) { const wchar_t kDocRoot[] = L"chrome/test/data"; scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); std::wstring test_file(test_data_directory_); scoped_ptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); diff --git a/chrome/browser/errorpage_uitest.cc b/chrome/browser/errorpage_uitest.cc index 78939498..c020762 100644 --- a/chrome/browser/errorpage_uitest.cc +++ b/chrome/browser/errorpage_uitest.cc @@ -39,7 +39,7 @@ TEST_F(ErrorPageTest, IFrame404) { // when the iframe loads. If the iframe fails to load (because an alternate // error page loads instead), then the title will remain as "FAIL". scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); GURL test_url = server->TestServerPage("files/iframe404.html"); NavigateToURL(test_url); diff --git a/chrome/browser/history/redirect_uitest.cc b/chrome/browser/history/redirect_uitest.cc index e9f7c0b..5610481 100644 --- a/chrome/browser/history/redirect_uitest.cc +++ b/chrome/browser/history/redirect_uitest.cc @@ -31,7 +31,7 @@ class RedirectTest : public UITest { // Tests a single server redirect TEST_F(RedirectTest, Server) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); GURL final_url = server->TestServerPageW(std::wstring()); @@ -53,7 +53,7 @@ TEST_F(RedirectTest, Server) { // Tests a single client redirect. TEST_F(RedirectTest, Client) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); GURL final_url = server->TestServerPageW(std::wstring()); @@ -77,7 +77,7 @@ TEST_F(RedirectTest, Client) { TEST_F(RedirectTest, ClientEmptyReferer) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); GURL final_url = server->TestServerPageW(std::wstring()); @@ -143,7 +143,7 @@ TEST_F(RedirectTest, ClientCancelled) { // failing. TEST_F(RedirectTest, DISABLED_ClientServerServer) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); GURL final_url = server->TestServerPageW(std::wstring()); @@ -177,7 +177,7 @@ TEST_F(RedirectTest, DISABLED_ClientServerServer) { // Tests that the "#reference" gets preserved across server redirects. TEST_F(RedirectTest, ServerReference) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); const std::string ref("reference"); @@ -198,7 +198,7 @@ TEST_F(RedirectTest, ServerReference) { // B) does not take place. TEST_F(RedirectTest, NoHttpToFile) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); std::wstring test_file = test_data_directory_; file_util::AppendToPath(&test_file, L"http_to_file.html"); @@ -221,7 +221,7 @@ TEST_F(RedirectTest, NoHttpToFile) { // flagged as client redirects. See bug 1139823. TEST_F(RedirectTest, ClientFragments) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); std::wstring test_file = test_data_directory_; @@ -259,7 +259,7 @@ TEST_F(RedirectTest, // for the response (which means it hasn't committed the load for the client // redirect destination page yet), we issue a new navigation request. scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); GURL final_url = server->TestServerPageW(std::wstring(L"files/title2.html")); diff --git a/chrome/browser/interstitial_page_uitest.cc b/chrome/browser/interstitial_page_uitest.cc index b7454b2..67b2435 100644 --- a/chrome/browser/interstitial_page_uitest.cc +++ b/chrome/browser/interstitial_page_uitest.cc @@ -55,7 +55,7 @@ class InterstitialPageTest : public UITest { // See bug 6729. TEST_F(InterstitialPageTest, DISABLED_TestShowHideInterstitial) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); ::scoped_ptr<TabProxy> tab(GetActiveTabProxy()); @@ -84,7 +84,7 @@ TEST_F(InterstitialPageTest, DISABLED_TestShowHideInterstitial) { // the interstitial, which breaks this test because no notification occurs. TEST_F(InterstitialPageTest, DISABLED_TestShowInterstitialThenBack) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); ::scoped_ptr<TabProxy> tab(GetActiveTabProxy()); @@ -103,7 +103,7 @@ TEST_F(InterstitialPageTest, DISABLED_TestShowInterstitialThenBack) { // Flacky on Windows 2000 bot. Disabled for now bug #1173138. TEST_F(InterstitialPageTest, DISABLED_TestShowInterstitialThenNavigate) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); ::scoped_ptr<TabProxy> tab(GetActiveTabProxy()); @@ -124,7 +124,7 @@ TEST_F(InterstitialPageTest, DISABLED_TestShowInterstitialThenNavigate) { // See bug 6729. TEST_F(InterstitialPageTest, DISABLED_TestShowInterstitialThenCloseTab) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // Create 2 tabs so closing one does not close the browser. @@ -142,7 +142,7 @@ TEST_F(InterstitialPageTest, DISABLED_TestShowInterstitialThenCloseTab) { // This test is disabled. See bug #1119448. TEST_F(InterstitialPageTest, DISABLED_TestShowInterstitialThenCloseBrowser) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); ::scoped_ptr<TabProxy> tab(GetActiveTabProxy()); diff --git a/chrome/browser/login_prompt_uitest.cc b/chrome/browser/login_prompt_uitest.cc index 47d046b..f3bb812 100644 --- a/chrome/browser/login_prompt_uitest.cc +++ b/chrome/browser/login_prompt_uitest.cc @@ -63,7 +63,7 @@ wstring ExpectedTitleFromAuth(wstring username, wstring password) { // Test that "Basic" HTTP authentication works. TEST_F(LoginPromptTest, TestBasicAuth) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); ::scoped_ptr<TabProxy> tab(GetActiveTabProxy()); NavigateTab(tab.get(), server->TestServerPageW(L"auth-basic")); @@ -85,7 +85,7 @@ TEST_F(LoginPromptTest, TestBasicAuth) { // Test that "Digest" HTTP authentication works. TEST_F(LoginPromptTest, TestDigestAuth) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); ::scoped_ptr<TabProxy> tab(GetActiveTabProxy()); NavigateTab(tab.get(), server->TestServerPageW(L"auth-digest")); @@ -106,7 +106,7 @@ TEST_F(LoginPromptTest, TestDigestAuth) { // Test that logging in on 2 tabs at once works. TEST_F(LoginPromptTest, TestTwoAuths) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); ::scoped_ptr<TabProxy> basic_tab(GetActiveTabProxy()); @@ -136,7 +136,7 @@ TEST_F(LoginPromptTest, TestTwoAuths) { // Test that cancelling authentication works. TEST_F(LoginPromptTest, TestCancelAuth) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); ::scoped_ptr<TabProxy> tab(GetActiveTabProxy()); diff --git a/chrome/browser/net/url_fetcher_unittest.cc b/chrome/browser/net/url_fetcher_unittest.cc index 11aafe7..03b40d7 100644 --- a/chrome/browser/net/url_fetcher_unittest.cc +++ b/chrome/browser/net/url_fetcher_unittest.cc @@ -347,7 +347,7 @@ TEST_F(URLFetcherTest, SameThreadsTest) { // thread, this will test URLFetcher's ability to do everything on one // thread. scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); CreateFetcher(GURL(server->TestServerPage("defaultresponse"))); @@ -357,7 +357,7 @@ TEST_F(URLFetcherTest, SameThreadsTest) { TEST_F(URLFetcherTest, DifferentThreadsTest) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // Create a separate thread that will create the URLFetcher. The current // (main) thread will do the IO, and when the fetch is complete it will @@ -374,7 +374,7 @@ TEST_F(URLFetcherTest, DifferentThreadsTest) { TEST_F(URLFetcherPostTest, Basic) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); CreateFetcher(GURL(server->TestServerPage("echo"))); MessageLoop::current()->Run(); @@ -382,7 +382,7 @@ TEST_F(URLFetcherPostTest, Basic) { TEST_F(URLFetcherHeadersTest, Headers) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data/url_request_unittest"); + HTTPTestServer::CreateServer(L"net/data/url_request_unittest", NULL); ASSERT_TRUE(NULL != server.get()); CreateFetcher(GURL(server->TestServerPage("files/with-headers.html"))); MessageLoop::current()->Run(); @@ -391,7 +391,7 @@ TEST_F(URLFetcherHeadersTest, Headers) { TEST_F(URLFetcherProtectTest, Overload) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); GURL url = GURL(server->TestServerPage("defaultresponse")); @@ -409,7 +409,7 @@ TEST_F(URLFetcherProtectTest, Overload) { TEST_F(URLFetcherProtectTest, ServerUnavailable) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); GURL url = GURL(server->TestServerPage("files/server-unavailable.html")); @@ -446,7 +446,7 @@ TEST_F(URLFetcherBadHTTPSTest, DISABLED_BadHTTPSTest) { TEST_F(URLFetcherCancelTest, ReleasesContext) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); GURL url = GURL(server->TestServerPage("files/server-unavailable.html")); diff --git a/chrome/browser/printing/printing_layout_uitest.cc b/chrome/browser/printing/printing_layout_uitest.cc index a337bef..4e9698f 100644 --- a/chrome/browser/printing/printing_layout_uitest.cc +++ b/chrome/browser/printing/printing_layout_uitest.cc @@ -482,7 +482,7 @@ TEST_F(PrintingLayoutTextTest, DISABLED_Complex) { // Print a document, check its output. scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); NavigateToURL(server->TestServerPage("files/printing/test1.html")); @@ -512,7 +512,8 @@ TEST_F(PrintingLayoutTestHidden, ManyTimes) { if (IsTestCaseDisabled()) return; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<HTTPTestServer> server( + HTTPTestServer::CreateServer(kDocRoot, NULL)); ASSERT_TRUE(NULL != server.get()); DismissTheWindow dismisser(base::GetProcId(process())); @@ -562,7 +563,8 @@ TEST_F(PrintingLayoutTest, DISABLED_Delayed) { if (IsTestCaseDisabled()) return; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<HTTPTestServer> server( + HTTPTestServer::CreateServer(kDocRoot, NULL)); ASSERT_TRUE(NULL != server.get()); { @@ -595,7 +597,8 @@ TEST_F(PrintingLayoutTest, IFrame) { if (IsTestCaseDisabled()) return; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<HTTPTestServer> server( + HTTPTestServer::CreateServer(kDocRoot, NULL)); ASSERT_TRUE(NULL != server.get()); { diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc index 49cafcd..5d3a6b8 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc @@ -90,7 +90,7 @@ TEST_F(ResourceDispatcherTest, ContentDispositionInline) { TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest) { const wchar_t kDocRoot[] = L"chrome/test/data"; scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); @@ -113,7 +113,7 @@ TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest) { TEST_F(ResourceDispatcherTest, SyncXMLHttpRequestDuringUnload) { const wchar_t kDocRoot[] = L"chrome/test/data"; scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); @@ -148,7 +148,7 @@ TEST_F(ResourceDispatcherTest, SyncXMLHttpRequestDuringUnload) { TEST_F(ResourceDispatcherTest, CrossSiteOnunloadCookie) { const wchar_t kDocRoot[] = L"chrome/test/data"; scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); @@ -227,7 +227,7 @@ TEST_F(ResourceDispatcherTest, CrossSiteNavigationNonBuffered) { TEST_F(ResourceDispatcherTest, CrossSiteNavigationErrorPage) { const wchar_t kDocRoot[] = L"chrome/test/data"; scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); scoped_ptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); diff --git a/chrome/browser/session_history_uitest.cc b/chrome/browser/session_history_uitest.cc index d4a1e2a..7abd170 100644 --- a/chrome/browser/session_history_uitest.cc +++ b/chrome/browser/session_history_uitest.cc @@ -108,7 +108,7 @@ class SessionHistoryTest : public UITest { TEST_F(SessionHistoryTest, BasicBackForward) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // about:blank should be loaded first. @@ -174,7 +174,7 @@ TEST_F(SessionHistoryTest, FrameBackForward) { return; scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // about:blank should be loaded first. @@ -240,7 +240,7 @@ TEST_F(SessionHistoryTest, FrameBackForward) { // Test that back/forward preserves POST data and document state in subframes. TEST_F(SessionHistoryTest, FrameFormBackForward) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // about:blank should be loaded first. @@ -302,7 +302,7 @@ TEST_F(SessionHistoryTest, FrameFormBackForward) { // across frames (ie, from frame -> nonframe). TEST_F(SessionHistoryTest, CrossFrameFormBackForward) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // about:blank should be loaded first. @@ -349,7 +349,7 @@ TEST_F(SessionHistoryTest, CrossFrameFormBackForward) { // navigations. Bug 730379. TEST_F(SessionHistoryTest, FragmentBackForward) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // about:blank should be loaded first. @@ -419,7 +419,7 @@ TEST_F(SessionHistoryTest, FragmentBackForward) { // since we'll be waiting forever for a load stop event. TEST_F(SessionHistoryTest, JavascriptHistory) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // about:blank should be loaded first. @@ -502,7 +502,7 @@ TEST_F(SessionHistoryTest, LocationReplace) { // Test that using location.replace doesn't leave the title of the old page // visible. scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); ASSERT_TRUE(tab_->NavigateToURL(server->TestServerPage( diff --git a/chrome/browser/sessions/session_restore_uitest.cc b/chrome/browser/sessions/session_restore_uitest.cc index 80fd0baf..7713b83 100644 --- a/chrome/browser/sessions/session_restore_uitest.cc +++ b/chrome/browser/sessions/session_restore_uitest.cc @@ -145,7 +145,7 @@ TEST_F(SessionRestoreUITest, RestoresForwardAndBackwardNavs) { TEST_F(SessionRestoreUITest, RestoresCrossSiteForwardAndBackwardNavs) { const wchar_t kDocRoot[] = L"chrome/test/data"; scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); GURL cross_site_url(server->TestServerPageW(L"files/title2.html")); diff --git a/chrome/browser/ssl/ssl_uitest.cc b/chrome/browser/ssl/ssl_uitest.cc index 2a84744..1819010 100644 --- a/chrome/browser/ssl/ssl_uitest.cc +++ b/chrome/browser/ssl/ssl_uitest.cc @@ -42,7 +42,7 @@ class SSLUITest : public UITest { } HTTPTestServer* PlainServer() { - return HTTPTestServer::CreateServer(kDocRoot); + return HTTPTestServer::CreateServer(kDocRoot, NULL); } HTTPSTestServer* GoodCertServer() { diff --git a/chrome/browser/tab_contents/view_source_uitest.cc b/chrome/browser/tab_contents/view_source_uitest.cc index 1cc19c6..d0089ee 100644 --- a/chrome/browser/tab_contents/view_source_uitest.cc +++ b/chrome/browser/tab_contents/view_source_uitest.cc @@ -39,7 +39,7 @@ class ViewSourceTest : public UITest { // page in view source) TEST_F(ViewSourceTest, DoesBrowserRenderInViewSource) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); std::string cookie = "viewsource_cookie"; std::string cookie_data = "foo"; @@ -64,7 +64,7 @@ TEST_F(ViewSourceTest, DoesBrowserRenderInViewSource) { // URL) if the URL was not changed (apart from adding the view-source prefix) TEST_F(ViewSourceTest, DoesBrowserConsumeViewSourcePrefix) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // First we navigate to google.html @@ -83,7 +83,7 @@ TEST_F(ViewSourceTest, DoesBrowserConsumeViewSourcePrefix) { // "View Source" from the Page menu. TEST_F(ViewSourceTest, ViewSourceInPageMenuEnabledOnANormalPage) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // First we navigate to google.html @@ -97,7 +97,7 @@ TEST_F(ViewSourceTest, ViewSourceInPageMenuEnabledOnANormalPage) { // "View Source" from the Page menu. TEST_F(ViewSourceTest, ViewSourceInPageMenuDisabledWhileViewingSource) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); // First we navigate to google.html diff --git a/chrome/browser/tab_restore_uitest.cc b/chrome/browser/tab_restore_uitest.cc index 48aea5a..e3ef0ef 100644 --- a/chrome/browser/tab_restore_uitest.cc +++ b/chrome/browser/tab_restore_uitest.cc @@ -133,7 +133,7 @@ TEST_F(TabRestoreUITest, RestoreToDifferentWindow) { TEST_F(TabRestoreUITest, RestoreWithExistingSiteInstance) { const wchar_t kDocRoot[] = L"chrome/test/data"; scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); GURL http_url1(server->TestServerPageW(L"files/title1.html")); GURL http_url2(server->TestServerPageW(L"files/title2.html")); @@ -178,7 +178,7 @@ TEST_F(TabRestoreUITest, RestoreWithExistingSiteInstance) { TEST_F(TabRestoreUITest, RestoreCrossSiteWithExistingSiteInstance) { const wchar_t kDocRoot[] = L"chrome/test/data"; scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); GURL http_url1(server->TestServerPageW(L"files/title1.html")); GURL http_url2(server->TestServerPageW(L"files/title2.html")); diff --git a/chrome/browser/views/find_bar_win_interactive_uitest.cc b/chrome/browser/views/find_bar_win_interactive_uitest.cc index 2923f26..9bb7d9c 100644 --- a/chrome/browser/views/find_bar_win_interactive_uitest.cc +++ b/chrome/browser/views/find_bar_win_interactive_uitest.cc @@ -53,7 +53,7 @@ bool ActivateTabByClick(AutomationProxy* automation, TEST_F(FindInPageTest, CrashEscHandlers) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); scoped_ptr<BrowserProxy> browser(automation()->GetLastActiveBrowserWindow()); diff --git a/chrome/browser/views/find_bar_win_uitest.cc b/chrome/browser/views/find_bar_win_uitest.cc index 94906b8..108e7ce 100644 --- a/chrome/browser/views/find_bar_win_uitest.cc +++ b/chrome/browser/views/find_bar_win_uitest.cc @@ -26,7 +26,7 @@ const std::wstring kTooFewMatchesPage = L"files/find_in_page/bug_1155639.html"; // This test loads a page with frames and starts FindInPage requests TEST_F(FindInPageControllerTest, FindInPageFrames) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); // First we navigate to our frames page. @@ -79,7 +79,7 @@ TEST_F(FindInPageControllerTest, FindInPageFrames) { // sense as we FindNext over all the items. TEST_F(FindInPageControllerTest, FindInPageOrdinal) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); // First we navigate to our frames page. @@ -117,7 +117,7 @@ TEST_F(FindInPageControllerTest, FindInPageOrdinal) { // sense. TEST_F(FindInPageControllerTest, FindInPageMultiFramesOrdinal) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); // First we navigate to our frames page. @@ -163,7 +163,7 @@ TEST_F(FindInPageControllerTest, FindInPageMultiFramesOrdinal) { // See http://crbug.com/5132 TEST_F(FindInPageControllerTest, FindInPage_Issue5132) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); // First we navigate to our frames page. @@ -194,7 +194,7 @@ TEST_F(FindInPageControllerTest, FindInPage_Issue5132) { // Load a page with no selectable text and make sure we don't crash. TEST_F(FindInPageControllerTest, FindUnSelectableText) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); GURL url = server->TestServerPageW(kUserSelectPage); @@ -210,7 +210,7 @@ TEST_F(FindInPageControllerTest, FindUnSelectableText) { // Try to reproduce the crash seen in issue 1341577. TEST_F(FindInPageControllerTest, FindCrash_Issue1341577) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); GURL url = server->TestServerPageW(kCrashPage); @@ -242,7 +242,7 @@ TEST_F(FindInPageControllerTest, FindCrash_Issue1341577) { // again from where it left off). TEST_F(FindInPageControllerTest, FindEnoughMatches_Issue1155639) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); GURL url = server->TestServerPageW(kTooFewMatchesPage); @@ -259,7 +259,7 @@ TEST_F(FindInPageControllerTest, FindEnoughMatches_Issue1155639) { // a new tab. TEST_F(FindInPageControllerTest, FindMovesOnTabClose_Issue1343052) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); GURL url = server->TestServerPageW(kFramePage); @@ -320,7 +320,7 @@ TEST_F(FindInPageControllerTest, FindMovesOnTabClose_Issue1343052) { // Make sure Find box disappears on Navigate but not on Refresh. TEST_F(FindInPageControllerTest, FindDisappearOnNavigate) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); GURL url = server->TestServerPageW(kUserSelectPage); diff --git a/chrome/common/chrome_plugin_unittest.cc b/chrome/common/chrome_plugin_unittest.cc index d7c581f..795c43a 100644 --- a/chrome/common/chrome_plugin_unittest.cc +++ b/chrome/common/chrome_plugin_unittest.cc @@ -262,7 +262,7 @@ TEST_F(ChromePluginTest, CanMakeGETRequestAsync) { // Tests that the plugin can issue a POST request. TEST_F(ChromePluginTest, CanMakePOSTRequest) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); GURL url = server->TestServerPage("echo"); diff --git a/chrome/common/net/cache_uitest.cc b/chrome/common/net/cache_uitest.cc index 19ecc01..4dc017f 100644 --- a/chrome/common/net/cache_uitest.cc +++ b/chrome/common/net/cache_uitest.cc @@ -55,7 +55,7 @@ void CacheTest::RunCacheTest(const std::wstring &url, bool expect_new_tab_cached, bool expect_delayed_reload) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); GURL test_page(server->TestServerPageW(url)); diff --git a/chrome/test/ui/inspector_controller_uitest.cc b/chrome/test/ui/inspector_controller_uitest.cc index 289cca0..b6d6163 100644 --- a/chrome/test/ui/inspector_controller_uitest.cc +++ b/chrome/test/ui/inspector_controller_uitest.cc @@ -38,7 +38,7 @@ TEST_F(InspectorControllerTest, DISABLED_InspectElement) { return; scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); ::scoped_ptr<TabProxy> tab(GetActiveTabProxy()); diff --git a/net/proxy/proxy_script_fetcher_unittest.cc b/net/proxy/proxy_script_fetcher_unittest.cc index 33b31c6..fae8c2d 100644 --- a/net/proxy/proxy_script_fetcher_unittest.cc +++ b/net/proxy/proxy_script_fetcher_unittest.cc @@ -182,7 +182,7 @@ TEST_F(ProxyScriptFetcherTest, FileUrl) { // with other browsers. TEST_F(ProxyScriptFetcherTest, HttpMimeType) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); SynchFetcher pac_fetcher; @@ -208,7 +208,7 @@ TEST_F(ProxyScriptFetcherTest, HttpMimeType) { TEST_F(ProxyScriptFetcherTest, HttpStatusCode) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); SynchFetcher pac_fetcher; @@ -228,7 +228,7 @@ TEST_F(ProxyScriptFetcherTest, HttpStatusCode) { TEST_F(ProxyScriptFetcherTest, ContentDisposition) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); SynchFetcher pac_fetcher; @@ -242,7 +242,7 @@ TEST_F(ProxyScriptFetcherTest, ContentDisposition) { TEST_F(ProxyScriptFetcherTest, TooLarge) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); SynchFetcher pac_fetcher; @@ -277,7 +277,7 @@ TEST_F(ProxyScriptFetcherTest, TooLarge) { TEST_F(ProxyScriptFetcherTest, Hang) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + HTTPTestServer::CreateServer(kDocRoot, NULL); ASSERT_TRUE(NULL != server.get()); SynchFetcher pac_fetcher; diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index c950492..5c9146f 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -84,7 +84,7 @@ class URLRequestTest : public PlatformTest { TEST_F(URLRequestTest, GetTest_NoCache) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L""); + HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); TestDelegate d; { @@ -106,7 +106,7 @@ TEST_F(URLRequestTest, GetTest_NoCache) { TEST_F(URLRequestTest, GetTest) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L""); + HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); TestDelegate d; { @@ -194,7 +194,7 @@ TEST_F(URLRequestTest, CancelTest) { TEST_F(URLRequestTest, CancelTest2) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L""); + HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); // error C2446: '!=' : no conversion from 'HTTPTestServer *const ' @@ -223,7 +223,7 @@ TEST_F(URLRequestTest, CancelTest2) { TEST_F(URLRequestTest, CancelTest3) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L""); + HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); TestDelegate d; { @@ -251,7 +251,7 @@ TEST_F(URLRequestTest, CancelTest3) { TEST_F(URLRequestTest, CancelTest4) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L""); + HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); TestDelegate d; { @@ -277,7 +277,7 @@ TEST_F(URLRequestTest, CancelTest4) { TEST_F(URLRequestTest, CancelTest5) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L""); + HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); scoped_refptr<URLRequestContext> context = new URLRequestHttpCacheContext(); @@ -313,7 +313,7 @@ TEST_F(URLRequestTest, CancelTest5) { TEST_F(URLRequestTest, PostTest) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data"); + HTTPTestServer::CreateServer(L"net/data", NULL); ASSERT_TRUE(NULL != server.get()); const int kMsgSize = 20000; // multiple of 10 const int kIterations = 50; @@ -365,7 +365,7 @@ TEST_F(URLRequestTest, PostTest) { TEST_F(URLRequestTest, PostEmptyTest) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data"); + HTTPTestServer::CreateServer(L"net/data", NULL); ASSERT_TRUE(NULL != server.get()); TestDelegate d; { @@ -390,7 +390,7 @@ TEST_F(URLRequestTest, PostEmptyTest) { TEST_F(URLRequestTest, PostFileTest) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data"); + HTTPTestServer::CreateServer(L"net/data", NULL); ASSERT_TRUE(NULL != server.get()); TestDelegate d; { @@ -521,7 +521,7 @@ TEST_F(URLRequestTest, DISABLED_DnsFailureTest) { TEST_F(URLRequestTest, ResponseHeadersTest) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data/url_request_unittest"); + HTTPTestServer::CreateServer(L"net/data/url_request_unittest", NULL); ASSERT_TRUE(NULL != server.get()); TestDelegate d; TestURLRequest req(server->TestServerPage("files/with-headers.html"), &d); @@ -546,7 +546,7 @@ TEST_F(URLRequestTest, ResponseHeadersTest) { TEST_F(URLRequestTest, BZip2ContentTest) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data/filter_unittests"); + HTTPTestServer::CreateServer(L"net/data/filter_unittests", NULL); ASSERT_TRUE(NULL != server.get()); // for localhost domain, we also should support bzip2 encoding @@ -572,7 +572,7 @@ TEST_F(URLRequestTest, BZip2ContentTest) { TEST_F(URLRequestTest, BZip2ContentTest_IncrementalHeader) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data/filter_unittests"); + HTTPTestServer::CreateServer(L"net/data/filter_unittests", NULL); ASSERT_TRUE(NULL != server.get()); // for localhost domain, we also should support bzip2 encoding @@ -673,7 +673,7 @@ TEST_F(URLRequestTest, ResolveShortcutTest) { TEST_F(URLRequestTest, ContentTypeNormalizationTest) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data/url_request_unittest"); + HTTPTestServer::CreateServer(L"net/data/url_request_unittest", NULL); ASSERT_TRUE(NULL != server.get()); TestDelegate d; @@ -722,7 +722,7 @@ TEST_F(URLRequestTest, FileDirCancelTest) { TEST_F(URLRequestTest, RestrictRedirects) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data/url_request_unittest"); + HTTPTestServer::CreateServer(L"net/data/url_request_unittest", NULL); ASSERT_TRUE(NULL != server.get()); TestDelegate d; @@ -737,7 +737,7 @@ TEST_F(URLRequestTest, RestrictRedirects) { TEST_F(URLRequestTest, NoUserPassInReferrer) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data/url_request_unittest"); + HTTPTestServer::CreateServer(L"net/data/url_request_unittest", NULL); ASSERT_TRUE(NULL != server.get()); TestDelegate d; TestURLRequest req(server->TestServerPage( @@ -751,7 +751,7 @@ TEST_F(URLRequestTest, NoUserPassInReferrer) { TEST_F(URLRequestTest, CancelRedirect) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data/url_request_unittest"); + HTTPTestServer::CreateServer(L"net/data/url_request_unittest", NULL); ASSERT_TRUE(NULL != server.get()); TestDelegate d; { @@ -770,7 +770,7 @@ TEST_F(URLRequestTest, CancelRedirect) { TEST_F(URLRequestTest, VaryHeader) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data/url_request_unittest"); + HTTPTestServer::CreateServer(L"net/data/url_request_unittest", NULL); ASSERT_TRUE(NULL != server.get()); scoped_refptr<URLRequestContext> context = new URLRequestHttpCacheContext(); @@ -821,7 +821,7 @@ TEST_F(URLRequestTest, VaryHeader) { TEST_F(URLRequestTest, BasicAuth) { scoped_refptr<URLRequestContext> context = new URLRequestHttpCacheContext(); scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L""); + HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); Time response_time; @@ -876,7 +876,7 @@ TEST_F(URLRequestTest, BasicAuth) { // http://code.google.com/p/chromium/issues/detail?id=843 TEST_F(URLRequestTest, Post302RedirectGet) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data/url_request_unittest"); + HTTPTestServer::CreateServer(L"net/data/url_request_unittest", NULL); ASSERT_TRUE(NULL != server.get()); TestDelegate d; TestURLRequest req(server->TestServerPage("files/redirect-to-echoall"), &d); @@ -916,7 +916,7 @@ TEST_F(URLRequestTest, Post302RedirectGet) { TEST_F(URLRequestTest, Post307RedirectPost) { scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data/url_request_unittest"); + HTTPTestServer::CreateServer(L"net/data/url_request_unittest", NULL); ASSERT_TRUE(NULL != server.get()); TestDelegate d; TestURLRequest req(server->TestServerPage("files/redirect307-to-echoall"), diff --git a/net/url_request/url_request_unittest.h b/net/url_request/url_request_unittest.h index 9389ce8..fff11f3 100644 --- a/net/url_request/url_request_unittest.h +++ b/net/url_request/url_request_unittest.h @@ -410,12 +410,16 @@ class BaseTestServer : public base::ProcessFilter, class HTTPTestServer : public BaseTestServer { protected: - HTTPTestServer() { + explicit HTTPTestServer() : loop_(NULL) { } public: - static HTTPTestServer* CreateServer(const std::wstring& document_root) { + // Creates and returns a new HTTPTestServer. If |loop| is non-null, requests + // are serviced on it, otherwise a new thread and message loop are created. + static HTTPTestServer* CreateServer(const std::wstring& document_root, + MessageLoop* loop) { HTTPTestServer* test_server = new HTTPTestServer(); + test_server->loop_ = loop; if (!test_server->Init(kDefaultHostName, kHTTPDefaultPort, document_root)) { delete test_server; return NULL; @@ -456,12 +460,18 @@ class HTTPTestServer : public BaseTestServer { // message loop, we also want to avoid spinning a nested message loop. SyncTestDelegate d; { - base::Thread io_thread("MakeGETRequest"); - base::Thread::Options options; - options.message_loop_type = MessageLoop::TYPE_IO; - io_thread.StartWithOptions(options); - io_thread.message_loop()->PostTask(FROM_HERE, NewRunnableFunction( - &HTTPTestServer::StartGETRequest, url, &d)); + MessageLoop* loop = loop_; + scoped_ptr<base::Thread> io_thread; + + if (!loop) { + io_thread.reset(new base::Thread("MakeGETRequest")); + base::Thread::Options options; + options.message_loop_type = MessageLoop::TYPE_IO; + io_thread->StartWithOptions(options); + loop = io_thread->message_loop(); + } + loop->PostTask(FROM_HERE, NewRunnableFunction( + &HTTPTestServer::StartGETRequest, url, &d)); // Build bot wait for only 300 seconds we should ensure wait do not take // more than 300 seconds @@ -519,6 +529,11 @@ class HTTPTestServer : public BaseTestServer { command_line->push_back("--data-dir=" + WideToUTF8(test_data_directory)); } #endif + + private: + // If non-null a background thread isn't created and instead this message loop + // is used. + MessageLoop* loop_; }; class HTTPSTestServer : public HTTPTestServer { |