diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-29 21:44:12 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-29 21:44:12 +0000 |
commit | 3985ba8a1d1e396d98c4dbec84077d6a67109db9 (patch) | |
tree | aa092101b582f5a9973fc68cce625834a9436c86 /chrome | |
parent | 4ada238a76785ee78396cfb8e5992044c302de1e (diff) | |
download | chromium_src-3985ba8a1d1e396d98c4dbec84077d6a67109db9.zip chromium_src-3985ba8a1d1e396d98c4dbec84077d6a67109db9.tar.gz chromium_src-3985ba8a1d1e396d98c4dbec84077d6a67109db9.tar.bz2 |
GTTF: Move more test server code from net/url_request/url_request_unittest.h
to net/test/test_server.h
No code changes, just a move.
TEST=none
BUG=49680
Review URL: http://codereview.chromium.org/3034038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54201 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
57 files changed, 396 insertions, 276 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_browsertest.cc b/chrome/browser/autocomplete/autocomplete_browsertest.cc index 11a8bc9..1a9bd60 100644 --- a/chrome/browser/autocomplete/autocomplete_browsertest.cc +++ b/chrome/browser/autocomplete/autocomplete_browsertest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/string_util.h" #include "chrome/browser/autocomplete/autocomplete.h" #include "chrome/browser/autocomplete/autocomplete_edit.h" #include "chrome/browser/autocomplete/autocomplete_edit_view.h" diff --git a/chrome/browser/browser_browsertest.cc b/chrome/browser/browser_browsertest.cc index 30324d0..528c9e4 100644 --- a/chrome/browser/browser_browsertest.cc +++ b/chrome/browser/browser_browsertest.cc @@ -34,6 +34,7 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "net/base/mock_host_resolver.h" +#include "net/test/test_server.h" namespace { @@ -98,7 +99,7 @@ class BrowserTest : public ExtensionBrowserTest { // Used by phantom tab tests. Creates two tabs, pins the first and makes it // a phantom tab (by closing it). void PhantomTabTest() { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); host_resolver()->AddRule("www.example.com", "127.0.0.1"); GURL url(server->TestServerPage("empty.html")); @@ -329,8 +330,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutFile) { IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutHttp) { CommandUpdater* command_updater = browser()->command_updater(); - scoped_refptr<HTTPTestServer> http_server( - HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> http_server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != http_server.get()); GURL http_url(http_server->TestServerPage("")); ASSERT_TRUE(http_url.SchemeIs(chrome::kHttpScheme)); @@ -341,8 +342,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutHttp) { IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutHttps) { CommandUpdater* command_updater = browser()->command_updater(); - scoped_refptr<HTTPSTestServer> https_server( - HTTPSTestServer::CreateGoodServer(kDocRoot)); + scoped_refptr<net::HTTPSTestServer> https_server( + net::HTTPSTestServer::CreateGoodServer(kDocRoot)); ASSERT_TRUE(NULL != https_server.get()); GURL https_url(https_server->TestServerPage("/")); ASSERT_TRUE(https_url.SchemeIs(chrome::kHttpsScheme)); @@ -353,8 +354,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutHttps) { IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutFtp) { CommandUpdater* command_updater = browser()->command_updater(); - scoped_refptr<FTPTestServer> ftp_server( - FTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::FTPTestServer> ftp_server( + net::FTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != ftp_server.get()); GURL ftp_url(ftp_server->TestServerPage("")); ASSERT_TRUE(ftp_url.SchemeIs(chrome::kFtpScheme)); @@ -388,8 +389,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, CommandCreateAppShortcutInvalid) { // to an anchor in javascript body.onload handler. IN_PROC_BROWSER_TEST_F(BrowserTest, FaviconOfOnloadRedirectToAnchorPage) { static const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server( - HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL url(server->TestServerPage("files/onload_redirect_to_anchor.html")); GURL expected_favicon_url(server->TestServerPage("files/test.png")); @@ -452,7 +453,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, RevivePhantomTab) { // Makes sure TabClosing is sent when uninstalling an extension that is an app // tab. IN_PROC_BROWSER_TEST_F(BrowserTest, TabClosingWhenRemovingExtension) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); host_resolver()->AddRule("www.example.com", "127.0.0.1"); GURL url(server->TestServerPage("empty.html")); @@ -509,8 +510,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, AppTabRemovedWhenExtensionUninstalled) { // Tests that the CLD (Compact Language Detection) works properly. IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageLanguageDetection) { static const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server( - HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); TabContents* current_tab = browser()->GetSelectedTabContents(); @@ -553,7 +554,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, MAYBE_PageLanguageDetection) { #endif // Makes sure pinned tabs are restored correctly on start. IN_PROC_BROWSER_TEST_F(BrowserTest, RestorePinnedTabs) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // Add an pinned app tab. @@ -669,7 +670,7 @@ class BrowserAppRefocusTest : public ExtensionBrowserTest { return true; } - HTTPTestServer* server_; + net::HTTPTestServer* server_; Extension* extension_app_; Profile* profile_; }; diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc index 1e0f2fc..aa79385 100644 --- a/chrome/browser/browser_focus_uitest.cc +++ b/chrome/browser/browser_focus_uitest.cc @@ -4,9 +4,11 @@ #include "build/build_config.h" +#include "base/file_util.h" #include "base/format_macros.h" #include "base/logging.h" #include "base/message_loop.h" +#include "base/path_service.h" #include "base/ref_counted.h" #include "chrome/browser/automation/ui_controls.h" #include "chrome/browser/browser.h" @@ -20,6 +22,7 @@ #include "chrome/common/chrome_paths.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" +#include "net/test/test_server.h" #if defined(TOOLKIT_VIEWS) || defined(OS_WIN) #include "views/focus/focus_manager.h" @@ -182,7 +185,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, ClickingMovesFocus) { IN_PROC_BROWSER_TEST_F(BrowserFocusTest, BrowsersRememberFocus) { BringBrowserWindowToFront(); - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our test page. @@ -247,7 +250,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, BrowsersRememberFocus) { // Tabs remember focus. IN_PROC_BROWSER_TEST_F(BrowserFocusTest, TabsRememberFocus) { BringBrowserWindowToFront(); - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our test page. @@ -323,7 +326,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, TabsRememberFocus) { // Tabs remember focus with find-in-page box. IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_TabsRememberFocusFindInPage) { BringBrowserWindowToFront(); - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our test page. @@ -363,7 +366,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_TabsRememberFocusFindInPage) { // Background window does not steal focus. IN_PROC_BROWSER_TEST_F(BrowserFocusTest, BackgroundBrowserDontStealFocus) { BringBrowserWindowToFront(); - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our test page. @@ -420,7 +423,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, BackgroundBrowserDontStealFocus) { // Page cannot steal focus when focus is on location bar. IN_PROC_BROWSER_TEST_F(BrowserFocusTest, LocationBarLockFocus) { BringBrowserWindowToFront(); - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // Open the page that steals focus. @@ -443,7 +446,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, LocationBarLockFocus) { // RenderWidget::didFocus()). IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) { BringBrowserWindowToFront(); - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our test page. @@ -537,7 +540,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) { // Focus traversal while an interstitial is showing. IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversalOnInterstitial) { BringBrowserWindowToFront(); - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our test page. @@ -629,7 +632,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversalOnInterstitial) { // Focus stays on page with interstitials. IN_PROC_BROWSER_TEST_F(BrowserFocusTest, InterstitialFocus) { BringBrowserWindowToFront(); - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our test page. @@ -666,7 +669,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, InterstitialFocus) { // Make sure Find box can request focus, even when it is already open. IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FindFocusTest) { BringBrowserWindowToFront(); - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // Open some page (any page that doesn't steal focus). @@ -767,7 +770,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, TabInitialFocus) { // Tests that focus goes where expected when using reload. IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) { BringBrowserWindowToFront(); - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // Open the new tab, reload. @@ -802,7 +805,7 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) { // Tests that focus goes where expected when using reload on a crashed tab. IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusOnReloadCrashedTab) { BringBrowserWindowToFront(); - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // Open a regular page, crash, reload. diff --git a/chrome/browser/browser_keyevents_browsertest.cc b/chrome/browser/browser_keyevents_browsertest.cc index 9c7ef65..e943bef 100644 --- a/chrome/browser/browser_keyevents_browsertest.cc +++ b/chrome/browser/browser_keyevents_browsertest.cc @@ -24,6 +24,7 @@ #include "chrome/common/notification_service.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" +#include "net/test/test_server.h" namespace { @@ -373,7 +374,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, NormalKeyEvents) { "U 65 0 false false false false" } }, }; - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); BringBrowserWindowToFront(); @@ -459,7 +460,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, CtrlKeyEvents) { "U 17 0 true false false false" } }; - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); BringBrowserWindowToFront(); @@ -505,7 +506,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, CommandKeyEvents) { "U 91 0 false false false true" } }; - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); BringBrowserWindowToFront(); @@ -609,7 +610,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_AccessKeys) { }; #endif - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); BringBrowserWindowToFront(); @@ -677,7 +678,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_AccessKeys) { #endif IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, MAYBE_ReservedAccelerators) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); BringBrowserWindowToFront(); @@ -835,7 +836,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, EditorKeyBindings) { "U 17 0 true false false false" } }; - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); BringBrowserWindowToFront(); @@ -873,7 +874,7 @@ IN_PROC_BROWSER_TEST_F(BrowserKeyEventsTest, PageUpDownKeys) { "U 34 0 false false false false" } }; - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); BringBrowserWindowToFront(); diff --git a/chrome/browser/browser_uitest.cc b/chrome/browser/browser_uitest.cc index d1976be..404edd8 100644 --- a/chrome/browser/browser_uitest.cc +++ b/chrome/browser/browser_uitest.cc @@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/base_paths.h" #include "base/file_path.h" #include "base/file_util.h" +#include "base/path_service.h" #include "base/string_util.h" #include "base/sys_info.h" #include "base/test/test_file_util.h" @@ -22,7 +24,7 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "net/base/net_util.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" namespace { @@ -136,7 +138,8 @@ TEST_F(BrowserTest, MAYBE_OtherRedirectsDontForkProcess) { return; const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); FilePath test_file(test_data_directory_); scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); diff --git a/chrome/browser/child_process_security_policy_browsertest.cc b/chrome/browser/child_process_security_policy_browsertest.cc index 41ec56a..336ba24 100644 --- a/chrome/browser/child_process_security_policy_browsertest.cc +++ b/chrome/browser/child_process_security_policy_browsertest.cc @@ -6,6 +6,7 @@ #include "base/basictypes.h" #include "base/file_path.h" +#include "base/process_util.h" #include "chrome/browser/browser.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/child_process_security_policy.h" diff --git a/chrome/browser/chrome_plugin_unittest.cc b/chrome/browser/chrome_plugin_unittest.cc index 7420458..09c73a0 100644 --- a/chrome/browser/chrome_plugin_unittest.cc +++ b/chrome/browser/chrome_plugin_unittest.cc @@ -17,6 +17,7 @@ #include "net/http/http_response_headers.h" #include "net/url_request/url_request_test_job.h" #include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" #include "testing/gtest/include/gtest/gtest.h" namespace { @@ -278,7 +279,8 @@ TEST_F(ChromePluginTest, CanMakeGETRequestAsync) { // Tests that the plugin can issue a POST request. TEST_F(ChromePluginTest, CanMakePOSTRequest) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL url = server->TestServerPage("echo"); diff --git a/chrome/browser/chromeos/login/account_screen_browsertest.cc b/chrome/browser/chromeos/login/account_screen_browsertest.cc index 5f39335..e43781b 100644 --- a/chrome/browser/chromeos/login/account_screen_browsertest.cc +++ b/chrome/browser/chromeos/login/account_screen_browsertest.cc @@ -14,6 +14,7 @@ #include "chrome/test/ui_test_utils.h" #include "net/url_request/url_request_about_job.h" #include "net/url_request/url_request_filter.h" +#include "net/test/test_server.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -27,7 +28,7 @@ class AccountScreenTest : public WizardInProcessBrowserTest { protected: // Overridden from WizardInProcessBrowserTest: virtual void SetUpWizard() { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server != NULL); GURL new_account_page_url(server->TestServerPage("files/new_account.html")); AccountScreen::set_new_account_page_url(new_account_page_url); diff --git a/chrome/browser/chromeos/notifications/notification_browsertest.cc b/chrome/browser/chromeos/notifications/notification_browsertest.cc index a1e1152..fc35d4a2 100644 --- a/chrome/browser/chromeos/notifications/notification_browsertest.cc +++ b/chrome/browser/chromeos/notifications/notification_browsertest.cc @@ -5,6 +5,8 @@ #include "app/x11_util.h" #include "base/message_loop.h" #include "base/ref_counted.h" +#include "base/string_util.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/notifications/balloon_collection_impl.h" diff --git a/chrome/browser/chromeos/options/wifi_config_view_browsertest.cc b/chrome/browser/chromeos/options/wifi_config_view_browsertest.cc index 07e846e..468328a 100644 --- a/chrome/browser/chromeos/options/wifi_config_view_browsertest.cc +++ b/chrome/browser/chromeos/options/wifi_config_view_browsertest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/chromeos/options/wifi_config_view.h" +#include "base/string_util.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" #include "chrome/browser/chromeos/cros/mock_network_library.h" diff --git a/chrome/browser/collected_cookies_uitest.cc b/chrome/browser/collected_cookies_uitest.cc index d51626a..e59d36d 100644 --- a/chrome/browser/collected_cookies_uitest.cc +++ b/chrome/browser/collected_cookies_uitest.cc @@ -11,7 +11,7 @@ #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/ui/ui_test.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" namespace { @@ -23,7 +23,8 @@ typedef UITest CollectedCookiesTest; // Test is flaky. http://crbug.com/49539 TEST_F(CollectedCookiesTest, FLAKY_DoubleDisplay) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); @@ -45,7 +46,8 @@ TEST_F(CollectedCookiesTest, FLAKY_DoubleDisplay) { // Test is flaky. http://crbug.com/49539 TEST_F(CollectedCookiesTest, FLAKY_NavigateAway) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); diff --git a/chrome/browser/debugger/devtools_sanity_unittest.cc b/chrome/browser/debugger/devtools_sanity_unittest.cc index 1910740..4a254dd 100644 --- a/chrome/browser/debugger/devtools_sanity_unittest.cc +++ b/chrome/browser/debugger/devtools_sanity_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/command_line.h" +#include "base/path_service.h" #include "chrome/browser/browser.h" #include "chrome/browser/debugger/devtools_client_host.h" #include "chrome/browser/debugger/devtools_manager.h" @@ -18,6 +19,7 @@ #include "chrome/common/notification_service.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" +#include "net/test/test_server.h" namespace { @@ -112,7 +114,7 @@ class DevToolsSanityTest : public InProcessBrowserTest { } void OpenDevToolsWindow(const std::string& test_page) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); GURL url = server->TestServerPage(test_page); ui_test_utils::NavigateToURL(browser(), url); diff --git a/chrome/browser/dom_ui/file_browse_browsertest.cc b/chrome/browser/dom_ui/file_browse_browsertest.cc index 4c4af11..eedd4eb 100644 --- a/chrome/browser/dom_ui/file_browse_browsertest.cc +++ b/chrome/browser/dom_ui/file_browse_browsertest.cc @@ -16,6 +16,7 @@ #include "chrome/common/url_constants.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" +#include "net/test/test_server.h" namespace { @@ -105,7 +106,7 @@ class FileBrowseUiObserver : public NotificationObserver { }; IN_PROC_BROWSER_TEST_F(FileBrowseBrowserTest, InputFileTriggerFileBrowse) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ui_test_utils::NavigateToURL(browser(), server->TestServerPage("files/input_file.html")); diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc index 99648b4..bed7228 100644 --- a/chrome/browser/download/save_page_browsertest.cc +++ b/chrome/browser/download/save_page_browsertest.cc @@ -3,6 +3,8 @@ // found in the LICENSE file. #include "base/file_path.h" +#include "base/file_util.h" +#include "base/path_service.h" #include "base/scoped_temp_dir.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/browser.h" diff --git a/chrome/browser/errorpage_uitest.cc b/chrome/browser/errorpage_uitest.cc index b7a0efb3..705dc14 100644 --- a/chrome/browser/errorpage_uitest.cc +++ b/chrome/browser/errorpage_uitest.cc @@ -7,7 +7,7 @@ #include "chrome/test/ui/ui_test.h" #include "chrome/browser/net/url_request_failed_dns_job.h" #include "chrome/browser/net/url_request_mock_http_job.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" class ErrorPageTest : public UITest { protected: @@ -168,8 +168,8 @@ TEST_F(ErrorPageTest, IFrame404) { // In this test, the iframe sets the title of the parent page to "SUCCESS" // 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"); + scoped_refptr<net::HTTPTestServer> server = + net::HTTPTestServer::CreateServer(L"chrome/test/data"); ASSERT_TRUE(NULL != server.get()); GURL test_url = server->TestServerPage("files/iframe404.html"); NavigateToURL(test_url); diff --git a/chrome/browser/extensions/extension_apitest.cc b/chrome/browser/extensions/extension_apitest.cc index 70708c8..36a0122 100644 --- a/chrome/browser/extensions/extension_apitest.cc +++ b/chrome/browser/extensions/extension_apitest.cc @@ -4,6 +4,7 @@ #include "chrome/browser/extensions/extension_apitest.h" +#include "base/string_util.h" #include "chrome/browser/browser.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/profile.h" diff --git a/chrome/browser/extensions/extension_apitest.h b/chrome/browser/extensions/extension_apitest.h index a22edd3..1d5a0b1 100644 --- a/chrome/browser/extensions/extension_apitest.h +++ b/chrome/browser/extensions/extension_apitest.h @@ -6,6 +6,9 @@ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_APITEST_H_ #pragma once +#include <deque> +#include <string> + #include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/common/notification_service.h" diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc index 685034d..71c9706 100644 --- a/chrome/browser/extensions/extension_browsertest.cc +++ b/chrome/browser/extensions/extension_browsertest.cc @@ -9,6 +9,7 @@ #include "base/command_line.h" #include "base/file_path.h" #include "base/path_service.h" +#include "base/string_util.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_window.h" #include "chrome/browser/location_bar.h" diff --git a/chrome/browser/extensions/extension_browsertests_misc.cc b/chrome/browser/extensions/extension_browsertests_misc.cc index 5e6ba57..f083fd0 100644 --- a/chrome/browser/extensions/extension_browsertests_misc.cc +++ b/chrome/browser/extensions/extension_browsertests_misc.cc @@ -27,6 +27,7 @@ #include "chrome/common/url_constants.h" #include "chrome/test/ui_test_utils.h" #include "net/base/net_util.h" +#include "net/test/test_server.h" const std::string kSubscribePage = "/subscribe.html"; const std::string kFeedPage = "files/feeds/feed.html"; @@ -206,7 +207,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TabContents) { // Tests that we can load page actions in the Omnibox. IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageAction) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // This page action will not show an icon, since it doesn't specify one but @@ -235,7 +236,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageAction) { // Tests that we don't lose the page action icon on in-page navigations. IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageActionInPageNavigation) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); FilePath extension_path(test_data_dir_.AppendASCII("api_test") @@ -261,7 +262,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageActionInPageNavigation) { // Tests that the location bar forgets about unloaded page actions. IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, UnloadPageAction) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); FilePath extension_path(test_data_dir_.AppendASCII("subscribe_page_action")); @@ -316,7 +317,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, PageActionRefreshCrash) { // Makes sure that the RSS detects RSS feed links, even when rel tag contains // more than just "alternate". IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, RSSMultiRelLink) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); ASSERT_TRUE(LoadExtension( @@ -355,7 +356,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TitleLocalizationBrowserAction) { // Tests that tooltips of a page action icon can be specified using UTF8. // See http://crbug.com/25349. IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TitleLocalizationPageAction) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); ExtensionsService* service = browser()->profile()->GetExtensionsService(); @@ -382,7 +383,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TitleLocalizationPageAction) { extension->page_action()->GetTitle(tab_id).c_str()); } -GURL GetFeedUrl(HTTPTestServer* server, const std::string& feed_page, +GURL GetFeedUrl(net::HTTPTestServer* server, const std::string& feed_page, bool direct_url, std::string extension_id) { GURL feed_url = server->TestServerPage(feed_page); if (direct_url) { @@ -445,7 +446,7 @@ bool ValidatePageElement(TabContents* tab, // extension to kick in, detect the feed and redirect to a feed preview page. // |sniff_xml_type| is generally set to true if the feed is sniffable and false // for invalid feeds. -void NavigateToFeedAndValidate(HTTPTestServer* server, +void NavigateToFeedAndValidate(net::HTTPTestServer* server, const std::string& url, Browser* browser, bool sniff_xml_type, @@ -484,7 +485,7 @@ void NavigateToFeedAndValidate(HTTPTestServer* server, } IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeed1) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); ASSERT_TRUE(LoadExtension( @@ -498,7 +499,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeed1) { } IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeed2) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); ASSERT_TRUE(LoadExtension( @@ -512,7 +513,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeed2) { } IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeed3) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); ASSERT_TRUE(LoadExtension( @@ -526,7 +527,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeed3) { } IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeed4) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); ASSERT_TRUE(LoadExtension( @@ -540,7 +541,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeed4) { } IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeed0) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); ASSERT_TRUE(LoadExtension( @@ -556,7 +557,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeed0) { } IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeed5) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); ASSERT_TRUE(LoadExtension( @@ -571,7 +572,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeed5) { } IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeed6) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); ASSERT_TRUE(LoadExtension( @@ -586,7 +587,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeed6) { } IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedInvalidFeed1) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); ASSERT_TRUE(LoadExtension( @@ -601,7 +602,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedInvalidFeed1) { } IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedInvalidFeed2) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); ASSERT_TRUE(LoadExtension( @@ -616,7 +617,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedInvalidFeed2) { } IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedInvalidFeed3) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); ASSERT_TRUE(LoadExtension( @@ -631,7 +632,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedInvalidFeed3) { } IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, ParseFeedValidFeedNoLinks) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); ASSERT_TRUE(LoadExtension( diff --git a/chrome/browser/extensions/extension_messages_apitest.cc b/chrome/browser/extensions/extension_messages_apitest.cc index 43703750..eed3657 100644 --- a/chrome/browser/extensions/extension_messages_apitest.cc +++ b/chrome/browser/extensions/extension_messages_apitest.cc @@ -6,6 +6,7 @@ #include "chrome/browser/extensions/extension_message_service.h" #include "chrome/browser/profile.h" #include "chrome/common/notification_registrar.h" +#include "googleurl/src/gurl.h" namespace { diff --git a/chrome/browser/extensions/extension_omnibox_apitest.cc b/chrome/browser/extensions/extension_omnibox_apitest.cc index 61021b5..bba834d 100644 --- a/chrome/browser/extensions/extension_omnibox_apitest.cc +++ b/chrome/browser/extensions/extension_omnibox_apitest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/string_util.h" #include "chrome/browser/autocomplete/autocomplete.h" #include "chrome/browser/autocomplete/autocomplete_edit.h" #include "chrome/browser/autocomplete/autocomplete_edit_view.h" diff --git a/chrome/browser/extensions/extension_websocket_apitest.cc b/chrome/browser/extensions/extension_websocket_apitest.cc index 3d2b6a5..8b2cc6c 100644 --- a/chrome/browser/extensions/extension_websocket_apitest.cc +++ b/chrome/browser/extensions/extension_websocket_apitest.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/path_service.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/ui_test_utils.h" diff --git a/chrome/browser/extensions/stubs_apitest.cc b/chrome/browser/extensions/stubs_apitest.cc index 091c9e3..fe06c6a 100644 --- a/chrome/browser/extensions/stubs_apitest.cc +++ b/chrome/browser/extensions/stubs_apitest.cc @@ -5,6 +5,8 @@ #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/ui_test_utils.h" +#include "googleurl/src/gurl.h" +#include "net/test/test_server.h" // Tests that we throw errors when you try using extension APIs that aren't // supported in content scripts. @@ -14,7 +16,8 @@ // should be available in content scripts) or update the list of privileged APIs // in renderer_extension_bindings.js. IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Stubs) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); + ASSERT_TRUE(server); ASSERT_TRUE(RunExtensionTest("stubs")) << message_; diff --git a/chrome/browser/find_bar_host_browsertest.cc b/chrome/browser/find_bar_host_browsertest.cc index 60bde4e..8af828d 100644 --- a/chrome/browser/find_bar_host_browsertest.cc +++ b/chrome/browser/find_bar_host_browsertest.cc @@ -16,6 +16,7 @@ #include "chrome/common/notification_service.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" +#include "net/test/test_server.h" #if defined(TOOLKIT_VIEWS) #include "chrome/browser/views/find_bar_host.h" @@ -113,7 +114,7 @@ int FindInPageWchar(TabContents* tab, // This test loads a page with frames and starts FindInPage requests. IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageFrames) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our frames page. @@ -206,7 +207,7 @@ std::string FocusedOnPage(TabContents* tab_contents) { // close the Find box (ie. if you find within a link the link should be // focused). IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageEndState) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our special focus tracking page. @@ -254,7 +255,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageEndState) { // This test loads a single-frame page and makes sure the ordinal returned makes // sense as we FindNext over all the items. IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageOrdinal) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our page. @@ -294,7 +295,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageOrdinal) { // This tests that the ordinal is correctly adjusted after a selection IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, SelectChangesOrdinal_Issue20883) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our test content. @@ -334,7 +335,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, // This test loads a page with frames and makes sure the ordinal returned makes // sense. IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageMultiFramesOrdinal) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our page. @@ -386,7 +387,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPageMultiFramesOrdinal) { // We could get ordinals out of whack when restarting search in subframes. // See http://crbug.com/5132. IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPage_Issue5132) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our page. @@ -417,7 +418,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindInPage_Issue5132) { // Load a page with no selectable text and make sure we don't crash. IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindUnSelectableText) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our page. @@ -436,7 +437,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindUnSelectableText) { // Try to reproduce the crash seen in issue 1341577. IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindCrash_Issue1341577) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our page. @@ -469,7 +470,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindCrash_Issue1341577) { // Try to reproduce the crash seen in http://crbug.com/14491, where an assert // hits in the BitStack size comparison in WebKit. IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindCrash_Issue14491) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our page. @@ -492,7 +493,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindCrash_Issue14491) { // ms) to find one or more of those matches (so Find times out and has to try // again from where it left off). IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindRestarts_Issue1155639) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our page. @@ -510,7 +511,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindRestarts_Issue1155639) { // This tests bug 11761: FindInPage terminates search prematurely. IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FAILS_FindInPagePrematureEnd) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our special focus tracking page. @@ -528,7 +529,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FAILS_FindInPagePrematureEnd) { } IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindDisappearOnNavigate) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our special focus tracking page. @@ -569,7 +570,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindDisappearOnNavigate) { // when a New Tab is opened. IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindDisappearOnNewTabAndHistory) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our special focus tracking page. @@ -617,7 +618,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, // Make sure Find box moves out of the way if it is obscuring the active match. IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, MAYBE_FindMovesWhenObscuring) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); GURL url = server->TestServerPage(kMoveIfOver); @@ -676,7 +677,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, MAYBE_FindMovesWhenObscuring) { // Make sure F3 in a new tab works if Find has previous string to search for. IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindNextInNewTabUsesPrepopulate) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to any page. @@ -723,7 +724,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, #else IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, AcceleratorRestoring) { #endif - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to any page. @@ -762,7 +763,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, // Make sure Find box does not become UI-inactive when no text is in the box as // we switch to a tab contents with an empty find string. See issue 13570. IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, StayActive) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to any page. @@ -787,7 +788,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, StayActive) { // Make sure F3 works after you FindNext a couple of times and end the Find // session. See issue http://crbug.com/28306. IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, RestartSearchFromF3) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to a simple page. @@ -819,7 +820,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, RestartSearchFromF3) { // with the last search from the same tab rather than the last overall search. // http://crbug.com/30006 IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, PreferPreviousSearch) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to any page. @@ -858,7 +859,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, PrepopulateSameTab) { return; #endif - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to any page. @@ -896,7 +897,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, PrepopulateInNewTab) { return; #endif - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to any page. @@ -932,7 +933,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, PrepopulatePreserveLast) { return; #endif - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to any page. @@ -1008,7 +1009,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, MAYBE_NoIncognitoPrepopulate) { return; #endif - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to the "simple" test page. @@ -1074,7 +1075,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, MAYBE_NoIncognitoPrepopulate) { // This makes sure that dismissing the find bar with kActivateSelection works. IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, MAYBE_ActivateLinkNavigatesPage) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to our test content. diff --git a/chrome/browser/geolocation/access_token_store_browsertest.cc b/chrome/browser/geolocation/access_token_store_browsertest.cc index 062fb28..1ce12918 100644 --- a/chrome/browser/geolocation/access_token_store_browsertest.cc +++ b/chrome/browser/geolocation/access_token_store_browsertest.cc @@ -4,6 +4,7 @@ #include "chrome/browser/geolocation/access_token_store.h" +#include "base/string_util.h" #include "chrome/browser/chrome_thread.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc index 7420eef..ceed9bf 100644 --- a/chrome/browser/geolocation/geolocation_browsertest.cc +++ b/chrome/browser/geolocation/geolocation_browsertest.cc @@ -29,6 +29,7 @@ #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "net/base/net_util.h" +#include "net/test/test_server.h" // Used to block until an iframe is loaded via a javascript call. // Note: NavigateToURLBlockUntilNavigationsComplete doesn't seem to work for @@ -330,7 +331,7 @@ class GeolocationBrowserTest : public InProcessBrowserTest { expected, function, current_browser_->GetSelectedTabContents()); } - scoped_refptr<HTTPTestServer> server_; + scoped_refptr<net::HTTPTestServer> server_; InfoBarDelegate* infobar_; Browser* current_browser_; // path element of a URL referencing the html content for this test. diff --git a/chrome/browser/gtk/bookmark_bar_gtk_interactive_uitest.cc b/chrome/browser/gtk/bookmark_bar_gtk_interactive_uitest.cc index c27c9ff..e8c2e74 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk_interactive_uitest.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk_interactive_uitest.cc @@ -9,6 +9,7 @@ #include "chrome/browser/gtk/view_id_util.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" +#include "net/test/test_server.h" namespace { @@ -27,7 +28,8 @@ class BookmarkBarGtkBrowserTest : public InProcessBrowserTest { // Makes sure that when you switch back to an NTP with an active findbar, // the findbar is above the floating bookmark bar. IN_PROC_BROWSER_TEST_F(BookmarkBarGtkBrowserTest, FindBarTest) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); // Create new tab; open findbar. @@ -54,7 +56,8 @@ IN_PROC_BROWSER_TEST_F(BookmarkBarGtkBrowserTest, FindBarTest) { // Makes sure that you can click on the floating bookmark bar. IN_PROC_BROWSER_TEST_F(BookmarkBarGtkBrowserTest, ClickOnFloatingTest) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GtkWidget* other_bookmarks = diff --git a/chrome/browser/history/multipart_uitest.cc b/chrome/browser/history/multipart_uitest.cc index f05b0a7..aabf593 100644 --- a/chrome/browser/history/multipart_uitest.cc +++ b/chrome/browser/history/multipart_uitest.cc @@ -6,9 +6,10 @@ #include "app/sql/connection.h" #include "app/sql/statement.h" +#include "base/file_util.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/browser_proxy.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" namespace { @@ -30,8 +31,8 @@ TEST_F(MultipartResponseUITest, MAYBE_SingleVisit) { // Make sure that visiting a multipart/x-mixed-replace site only // creates one entry in the visits table. const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(kDocRoot); + scoped_refptr<net::HTTPTestServer> server = + net::HTTPTestServer::CreateServer(kDocRoot); ASSERT_TRUE(NULL != server.get()); scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); diff --git a/chrome/browser/history/redirect_uitest.cc b/chrome/browser/history/redirect_uitest.cc index 4c3fe38..67b9a62 100644 --- a/chrome/browser/history/redirect_uitest.cc +++ b/chrome/browser/history/redirect_uitest.cc @@ -15,7 +15,7 @@ #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/ui/ui_test.h" #include "net/base/net_util.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" namespace { @@ -25,7 +25,8 @@ typedef UITest RedirectTest; // Tests a single server redirect TEST_F(RedirectTest, Server) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL final_url = server->TestServerPage(std::string()); @@ -46,7 +47,8 @@ TEST_F(RedirectTest, Server) { // Tests a single client redirect. TEST_F(RedirectTest, Client) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL final_url = server->TestServerPage(std::string()); @@ -79,7 +81,8 @@ TEST_F(RedirectTest, Client) { } TEST_F(RedirectTest, ClientEmptyReferer) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL final_url = server->TestServerPage(std::string()); @@ -138,7 +141,8 @@ TEST_F(RedirectTest, ClientCancelled) { // Tests a client->server->server redirect TEST_F(RedirectTest, ClientServerServer) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL final_url = server->TestServerPage(std::string()); @@ -171,7 +175,8 @@ TEST_F(RedirectTest, ClientServerServer) { // Tests that the "#reference" gets preserved across server redirects. TEST_F(RedirectTest, ServerReference) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); const std::string ref("reference"); @@ -190,7 +195,8 @@ TEST_F(RedirectTest, ServerReference) { // A) does not crash the browser or confuse the redirect chain, see bug 1080873 // B) does not take place. TEST_F(RedirectTest, NoHttpToFile) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); FilePath test_file(test_data_directory_); test_file = test_file.AppendASCII("http_to_file.html"); @@ -212,7 +218,8 @@ TEST_F(RedirectTest, NoHttpToFile) { // Ensures that non-user initiated location changes (within page) are // flagged as client redirects. See bug 1139823. TEST_F(RedirectTest, ClientFragments) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); FilePath test_file(test_data_directory_); @@ -245,7 +252,8 @@ TEST_F(RedirectTest, // which causes it to start a provisional load, and while it is waiting // 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)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL final_url = server->TestServerPage("files/title2.html"); diff --git a/chrome/browser/login_prompt_uitest.cc b/chrome/browser/login_prompt_uitest.cc index e273fe6..91ee08f 100644 --- a/chrome/browser/login_prompt_uitest.cc +++ b/chrome/browser/login_prompt_uitest.cc @@ -10,7 +10,7 @@ #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/ui/ui_test.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" using std::wstring; @@ -51,7 +51,8 @@ wstring ExpectedTitleFromAuth(const wstring& username, // Test that "Basic" HTTP authentication works. TEST_F(LoginPromptTest, TestBasicAuth) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<TabProxy> tab(GetActiveTab()); ASSERT_TRUE(tab.get()); @@ -73,7 +74,8 @@ TEST_F(LoginPromptTest, TestBasicAuth) { // Test that "Digest" HTTP authentication works. TEST_F(LoginPromptTest, TestDigestAuth) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<TabProxy> tab(GetActiveTab()); ASSERT_TRUE(tab.get()); @@ -94,7 +96,8 @@ 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)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<TabProxy> basic_tab(GetActiveTab()); @@ -122,7 +125,8 @@ TEST_F(LoginPromptTest, TestTwoAuths) { // Test that cancelling authentication works. TEST_F(LoginPromptTest, TestCancelAuth) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<TabProxy> tab(GetActiveTab()); ASSERT_TRUE(tab.get()); @@ -161,7 +165,8 @@ TEST_F(LoginPromptTest, TestCancelAuth) { // If multiple tabs are looking for the same auth, the user should only have to // enter it once (http://crbug.com/8914). TEST_F(LoginPromptTest, SupplyRedundantAuths) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<TabProxy> basic_tab1(GetActiveTab()); @@ -195,7 +200,8 @@ TEST_F(LoginPromptTest, SupplyRedundantAuths) { // If multiple tabs are looking for the same auth, and one is cancelled, the // other should be cancelled as well. TEST_F(LoginPromptTest, CancelRedundantAuths) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<TabProxy> basic_tab1(GetActiveTab()); diff --git a/chrome/browser/net/connection_tester_unittest.cc b/chrome/browser/net/connection_tester_unittest.cc index bb6dbf8..01a0345 100644 --- a/chrome/browser/net/connection_tester_unittest.cc +++ b/chrome/browser/net/connection_tester_unittest.cc @@ -5,7 +5,7 @@ #include "chrome/browser/net/connection_tester.h" #include "net/base/mock_host_resolver.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -87,8 +87,8 @@ class ConnectionTesterTest : public PlatformTest { }; TEST_F(ConnectionTesterTest, RunAllTests) { - scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data/url_request_unittest/"); + scoped_refptr<net::HTTPTestServer> server = + net::HTTPTestServer::CreateServer(L"net/data/url_request_unittest/"); ConnectionTester tester(&test_delegate_); @@ -113,8 +113,8 @@ TEST_F(ConnectionTesterTest, RunAllTests) { } TEST_F(ConnectionTesterTest, DeleteWhileInProgress) { - scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data/url_request_unittest/"); + scoped_refptr<net::HTTPTestServer> server = + net::HTTPTestServer::CreateServer(L"net/data/url_request_unittest/"); scoped_ptr<ConnectionTester> tester(new ConnectionTester(&test_delegate_)); diff --git a/chrome/browser/net/cookie_policy_browsertest.cc b/chrome/browser/net/cookie_policy_browsertest.cc index e43cd14..5b903e2 100644 --- a/chrome/browser/net/cookie_policy_browsertest.cc +++ b/chrome/browser/net/cookie_policy_browsertest.cc @@ -10,7 +10,9 @@ #include "chrome/common/net/url_request_context_getter.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" +#include "net/base/cookie_store.h" #include "net/base/mock_host_resolver.h" +#include "net/test/test_server.h" namespace { @@ -63,7 +65,7 @@ class CookiePolicyBrowserTest : public InProcessBrowserTest { // Visits a page that sets a first-party cookie. IN_PROC_BROWSER_TEST_F(CookiePolicyBrowserTest, AllowFirstPartyCookies) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server != NULL); browser()->profile()->GetHostContentSettingsMap()-> @@ -84,7 +86,7 @@ IN_PROC_BROWSER_TEST_F(CookiePolicyBrowserTest, AllowFirstPartyCookies) { // a first-party cookie. IN_PROC_BROWSER_TEST_F(CookiePolicyBrowserTest, AllowFirstPartyCookiesRedirect) { - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server != NULL); browser()->profile()->GetHostContentSettingsMap()-> diff --git a/chrome/browser/net/ftp_browsertest.cc b/chrome/browser/net/ftp_browsertest.cc index 3f23e00..5033bf9 100644 --- a/chrome/browser/net/ftp_browsertest.cc +++ b/chrome/browser/net/ftp_browsertest.cc @@ -4,16 +4,16 @@ #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" #include "testing/gtest/include/gtest/gtest.h" class FtpBrowserTest : public InProcessBrowserTest { public: - FtpBrowserTest() : server_(FTPTestServer::CreateServer(L"")) { + FtpBrowserTest() : server_(net::FTPTestServer::CreateServer(L"")) { } protected: - scoped_refptr<FTPTestServer> server_; + scoped_refptr<net::FTPTestServer> server_; }; IN_PROC_BROWSER_TEST_F(FtpBrowserTest, DirectoryListing) { diff --git a/chrome/browser/notifications/notifications_interactive_uitest.cc b/chrome/browser/notifications/notifications_interactive_uitest.cc index 55d4a82..656017a 100644 --- a/chrome/browser/notifications/notifications_interactive_uitest.cc +++ b/chrome/browser/notifications/notifications_interactive_uitest.cc @@ -8,7 +8,7 @@ #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/ui/ui_test.h" #include "net/base/net_util.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" class NotificationsPermissionTest : public UITest { public: @@ -20,7 +20,8 @@ class NotificationsPermissionTest : public UITest { TEST_F(NotificationsPermissionTest, TestUserGestureInfobar) { const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(server.get() != NULL); scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); @@ -46,7 +47,8 @@ TEST_F(NotificationsPermissionTest, TestUserGestureInfobar) { TEST_F(NotificationsPermissionTest, TestNoUserGestureInfobar) { const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(server.get() != NULL); scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); diff --git a/chrome/browser/printing/print_dialog_cloud_uitest.cc b/chrome/browser/printing/print_dialog_cloud_uitest.cc index 5d15923..1cdd073 100644 --- a/chrome/browser/printing/print_dialog_cloud_uitest.cc +++ b/chrome/browser/printing/print_dialog_cloud_uitest.cc @@ -22,6 +22,7 @@ #include "chrome/test/ui_test_utils.h" #include "net/url_request/url_request_filter.h" #include "net/url_request/url_request_test_job.h" +#include "net/url_request/url_request_unittest.h" namespace { diff --git a/chrome/browser/printing/printing_layout_uitest.cc b/chrome/browser/printing/printing_layout_uitest.cc index f559c33..db20963 100644 --- a/chrome/browser/printing/printing_layout_uitest.cc +++ b/chrome/browser/printing/printing_layout_uitest.cc @@ -13,7 +13,7 @@ #include "chrome/test/automation/window_proxy.h" #include "chrome/test/ui/ui_test.h" #include "gfx/gdi_util.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" #include "printing/image.h" #include "printing/printing_test.h" #include "printing/native_metafile.h" @@ -292,7 +292,8 @@ TEST_F(PrintingLayoutTextTest, FAILS_Complex) { "close_printdlg_thread"); // Print a document, check its output. - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); NavigateToURL(server->TestServerPage("files/printing/test1.html")); @@ -323,7 +324,8 @@ TEST_F(PrintingLayoutTestHidden, DISABLED_ManyTimes) { if (IsTestCaseDisabled()) return; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); DismissTheWindow dismisser(base::GetProcId(process())); @@ -373,7 +375,8 @@ TEST_F(PrintingLayoutTest, DISABLED_Delayed) { if (IsTestCaseDisabled()) return; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); { @@ -407,7 +410,8 @@ TEST_F(PrintingLayoutTest, DISABLED_IFrame) { if (IsTestCaseDisabled()) return; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); 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 dcf7b1e..f204e0b 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc @@ -17,7 +17,7 @@ #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/ui/ui_test.h" #include "net/base/net_util.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" namespace { @@ -79,7 +79,8 @@ TEST_F(ResourceDispatcherTest, ContentDispositionInline) { // Test for bug #1091358. TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest) { const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); @@ -100,7 +101,8 @@ TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest) { TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest_Disallowed) { const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); @@ -124,7 +126,8 @@ TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest_Disallowed) { // if executed while navigating to a new page. TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest_DuringUnload) { const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); @@ -160,7 +163,8 @@ TEST_F(ResourceDispatcherTest, SyncXMLHttpRequest_DuringUnload) { // Tests that onunload is run for cross-site requests. (Bug 1114994) TEST_F(ResourceDispatcherTest, CrossSiteOnunloadCookie) { const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); @@ -254,7 +258,8 @@ TEST_F(ResourceDispatcherTest, CrossSiteNavigationNonBuffered) { // away from the link doctor page. (Bug 1235537) TEST_F(ResourceDispatcherTest, CrossSiteNavigationErrorPage) { const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); diff --git a/chrome/browser/renderer_host/test/render_view_host_manager_browsertest.cc b/chrome/browser/renderer_host/test/render_view_host_manager_browsertest.cc index a98ff5a..0223cb5 100644 --- a/chrome/browser/renderer_host/test/render_view_host_manager_browsertest.cc +++ b/chrome/browser/renderer_host/test/render_view_host_manager_browsertest.cc @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/file_util.h" +#include "base/path_service.h" +#include "base/ref_counted.h" #include "chrome/browser/browser.h" #include "chrome/browser/download/download_manager.h" #include "chrome/browser/extensions/extension_error_reporter.h" @@ -18,6 +21,7 @@ #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "net/base/net_util.h" +#include "net/test/test_server.h" class RenderViewHostManagerTest : public InProcessBrowserTest { public: @@ -32,10 +36,10 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, SwapProcessWithRelNoreferrerAndTargetBlank) { // Start two servers with different sites. const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> http_server = - HTTPTestServer::CreateServer(kDocRoot); - scoped_refptr<HTTPSTestServer> https_server = - HTTPSTestServer::CreateGoodServer(kDocRoot); + scoped_refptr<net::HTTPTestServer> http_server = + net::HTTPTestServer::CreateServer(kDocRoot); + scoped_refptr<net::HTTPSTestServer> https_server = + net::HTTPSTestServer::CreateGoodServer(kDocRoot); // Load a page with links that open in a new window. ui_test_utils::NavigateToURL(browser(), http_server->TestServerPage( @@ -75,10 +79,10 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, DontSwapProcessWithOnlyTargetBlank) { // Start two servers with different sites. const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> http_server = - HTTPTestServer::CreateServer(kDocRoot); - scoped_refptr<HTTPSTestServer> https_server = - HTTPSTestServer::CreateGoodServer(kDocRoot); + scoped_refptr<net::HTTPTestServer> http_server = + net::HTTPTestServer::CreateServer(kDocRoot); + scoped_refptr<net::HTTPSTestServer> https_server = + net::HTTPSTestServer::CreateGoodServer(kDocRoot); // Load a page with links that open in a new window. ui_test_utils::NavigateToURL(browser(), http_server->TestServerPage( @@ -118,10 +122,10 @@ IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, DontSwapProcessWithOnlyRelNoreferrer) { // Start two servers with different sites. const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> http_server = - HTTPTestServer::CreateServer(kDocRoot); - scoped_refptr<HTTPSTestServer> https_server = - HTTPSTestServer::CreateGoodServer(kDocRoot); + scoped_refptr<net::HTTPTestServer> http_server = + net::HTTPTestServer::CreateServer(kDocRoot); + scoped_refptr<net::HTTPSTestServer> https_server = + net::HTTPSTestServer::CreateGoodServer(kDocRoot); // Load a page with links that open in a new window. ui_test_utils::NavigateToURL(browser(), http_server->TestServerPage( diff --git a/chrome/browser/renderer_host/test/web_cache_manager_browsertest.cc b/chrome/browser/renderer_host/test/web_cache_manager_browsertest.cc index 1182c7d..0779b00 100644 --- a/chrome/browser/renderer_host/test/web_cache_manager_browsertest.cc +++ b/chrome/browser/renderer_host/test/web_cache_manager_browsertest.cc @@ -5,6 +5,7 @@ #include <string> #include "base/message_loop.h" +#include "base/process_util.h" #include "chrome/browser/browser.h" #include "chrome/browser/renderer_host/render_process_host.h" #include "chrome/browser/renderer_host/web_cache_manager.h" diff --git a/chrome/browser/repost_form_warning_uitest.cc b/chrome/browser/repost_form_warning_uitest.cc index d5fef12..8f779c7 100644 --- a/chrome/browser/repost_form_warning_uitest.cc +++ b/chrome/browser/repost_form_warning_uitest.cc @@ -11,7 +11,7 @@ #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/ui/ui_test.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" namespace { @@ -29,7 +29,8 @@ typedef UITest RepostFormWarningTest; #endif TEST_F(RepostFormWarningTest, MAYBE_TestDoubleReload) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); @@ -59,7 +60,8 @@ TEST_F(RepostFormWarningTest, MAYBE_TestDoubleReload) { #endif TEST_F(RepostFormWarningTest, MAYBE_TestLoginAfterRepost) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); diff --git a/chrome/browser/session_history_uitest.cc b/chrome/browser/session_history_uitest.cc index 3f7c5ae..602e9c4 100644 --- a/chrome/browser/session_history_uitest.cc +++ b/chrome/browser/session_history_uitest.cc @@ -11,7 +11,7 @@ #include "chrome/test/ui/ui_test.h" #include "grit/generated_resources.h" #include "net/base/net_util.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" namespace { @@ -80,7 +80,8 @@ class SessionHistoryTest : public UITest { }; TEST_F(SessionHistoryTest, BasicBackForward) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); // about:blank should be loaded first. @@ -146,7 +147,8 @@ TEST_F(SessionHistoryTest, BasicBackForward) { #define MAYBE_FrameBackForward FrameBackForward #endif TEST_F(SessionHistoryTest, MAYBE_FrameBackForward) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); // about:blank should be loaded first. @@ -211,7 +213,8 @@ TEST_F(SessionHistoryTest, MAYBE_FrameBackForward) { // Test that back/forward preserves POST data and document state in subframes. TEST_F(SessionHistoryTest, FrameFormBackForward) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); // about:blank should be loaded first. @@ -272,7 +275,8 @@ TEST_F(SessionHistoryTest, FrameFormBackForward) { // across frames (ie, from frame -> nonframe). // Hangs, see http://crbug.com/45058. TEST_F(SessionHistoryTest, DISABLED_CrossFrameFormBackForward) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); // about:blank should be loaded first. @@ -317,7 +321,8 @@ TEST_F(SessionHistoryTest, DISABLED_CrossFrameFormBackForward) { // Test that back/forward entries are created for reference fragment // navigations. Bug 730379. TEST_F(SessionHistoryTest, FragmentBackForward) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); // about:blank should be loaded first. @@ -389,7 +394,8 @@ TEST_F(SessionHistoryTest, FragmentBackForward) { // TODO(brettw) bug 50648: fix flakyness. This test seems like it was failing // about 1/4 of the time on Vista by failing to execute JavascriptGo (see bug). TEST_F(SessionHistoryTest, FLAKY_JavascriptHistory) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); // about:blank should be loaded first. @@ -472,7 +478,8 @@ TEST_F(SessionHistoryTest, FLAKY_JavascriptHistory) { TEST_F(SessionHistoryTest, FAILS_LocationReplace) { // Test that using location.replace doesn't leave the title of the old page // visible. - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); ASSERT_TRUE(tab_->NavigateToURL(server->TestServerPage( @@ -498,7 +505,8 @@ TEST_F(SessionHistoryTest, FLAKY_HistorySearchXSS) { } TEST_F(SessionHistoryTest, LocationChangeInSubframe) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(server.get()); ASSERT_TRUE(tab_->NavigateToURL(server->TestServerPage( @@ -518,7 +526,8 @@ TEST_F(SessionHistoryTest, LocationChangeInSubframe) { #define HistoryLength DISABLED_HistoryLength #endif // defined(OS_WIN) TEST_F(SessionHistoryTest, HistoryLength) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(server.get()); int length; diff --git a/chrome/browser/sessions/session_restore_uitest.cc b/chrome/browser/sessions/session_restore_uitest.cc index 64ccddc..5e0c487 100644 --- a/chrome/browser/sessions/session_restore_uitest.cc +++ b/chrome/browser/sessions/session_restore_uitest.cc @@ -16,7 +16,7 @@ #include "chrome/test/ui/ui_test.h" #include "googleurl/src/gurl.h" #include "net/base/net_util.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" namespace { @@ -145,7 +145,8 @@ TEST_F(SessionRestoreUITest, RestoresForwardAndBackwardNavs) { // cross-site page and then forward again works. (Bug 1204135) TEST_F(SessionRestoreUITest, RestoresCrossSiteForwardAndBackwardNavs) { const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL cross_site_url(server->TestServerPage("files/title2.html")); diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc index a0d2279..aab0cd2 100644 --- a/chrome/browser/ssl/ssl_browser_tests.cc +++ b/chrome/browser/ssl/ssl_browser_tests.cc @@ -12,6 +12,8 @@ #include "chrome/common/pref_names.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" +#include "net/base/cert_status_flags.h" +#include "net/test/test_server.h" const wchar_t kDocRoot[] = L"chrome/test/data"; @@ -21,16 +23,16 @@ class SSLUITest : public InProcessBrowserTest { EnableDOMAutomation(); } - scoped_refptr<HTTPTestServer> PlainServer() { - return HTTPTestServer::CreateServer(kDocRoot); + scoped_refptr<net::HTTPTestServer> PlainServer() { + return net::HTTPTestServer::CreateServer(kDocRoot); } - scoped_refptr<HTTPSTestServer> GoodCertServer() { - return HTTPSTestServer::CreateGoodServer(kDocRoot); + scoped_refptr<net::HTTPSTestServer> GoodCertServer() { + return net::HTTPSTestServer::CreateGoodServer(kDocRoot); } - scoped_refptr<HTTPSTestServer> BadCertServer() { - return HTTPSTestServer::CreateExpiredServer(kDocRoot); + scoped_refptr<net::HTTPSTestServer> BadCertServer() { + return net::HTTPSTestServer::CreateExpiredServer(kDocRoot); } void CheckAuthenticatedState(TabContents* tab, @@ -120,7 +122,7 @@ class SSLUITest : public InProcessBrowserTest { // Visits a regular page over http. IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTP) { - scoped_refptr<HTTPTestServer> server = PlainServer(); + scoped_refptr<net::HTTPTestServer> server = PlainServer(); ASSERT_TRUE(server.get() != NULL); ui_test_utils::NavigateToURL(browser(), @@ -134,9 +136,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTP) { // TODO(jcampan): test that bad HTTPS content is blocked (otherwise we'll give // the secure cookies away!). IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPWithBrokenHTTPSResource) { - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); ui_test_utils::NavigateToURL(browser(), @@ -147,7 +149,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPWithBrokenHTTPSResource) { // Visits a page over OK https: IN_PROC_BROWSER_TEST_F(SSLUITest, TestOKHTTPS) { - scoped_refptr<HTTPSTestServer> https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> https_server = GoodCertServer(); ASSERT_TRUE(https_server.get() != NULL); ui_test_utils::NavigateToURL(browser(), @@ -158,7 +160,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestOKHTTPS) { // Visits a page with https error and proceed: IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndProceed) { - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); ui_test_utils::NavigateToURL(browser(), @@ -186,11 +188,11 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndProceed) { FLAKY_TestHTTPSExpiredCertAndDontProceed #endif IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestHTTPSExpiredCertAndDontProceed) { - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); - scoped_refptr<HTTPSTestServer> good_https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> good_https_server = GoodCertServer(); ASSERT_TRUE(good_https_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); // First navigate to an OK page. @@ -234,9 +236,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestHTTPSExpiredCertAndDontProceed) { // Visits a page with https error and then goes back using Browser::GoBack. IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndGoBackViaButton) { - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); // First navigate to an HTTP page. @@ -263,9 +265,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSExpiredCertAndGoBackViaButton) { // Visits a page with https error and then goes back using GoToOffset. // Marked as flaky, see bug 40932. IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestHTTPSExpiredCertAndGoBackViaMenu) { - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); // First navigate to an HTTP page. @@ -292,9 +294,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestHTTPSExpiredCertAndGoBackViaMenu) { // Visits a page with https error and then goes forward using GoToOffset. // Marked as flaky, see bug 40932. IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestHTTPSExpiredCertAndGoForward) { - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); // First navigate to two HTTP pages. @@ -338,9 +340,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestHTTPSExpiredCertAndGoForward) { // 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<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); // Load a page with a link that opens a new window (therefore with no history @@ -382,9 +384,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestHTTPSErrorWithNoNavEntry) { // Visits a page that displays insecure content. IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContent) { - scoped_refptr<HTTPSTestServer> https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> https_server = GoodCertServer(); ASSERT_TRUE(https_server.get() != NULL); - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); // Load a page that displays insecure content. @@ -398,9 +400,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContent) { // content warnings by randomizing location.hash. // Based on http://crbug.com/8706 IN_PROC_BROWSER_TEST_F(SSLUITest, TestRunsInsecuredContentRandomizeHash) { - scoped_refptr<HTTPSTestServer> https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> https_server = GoodCertServer(); ASSERT_TRUE(https_server.get() != NULL); - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); ui_test_utils::NavigateToURL(browser(), https_server->TestServerPage( @@ -415,9 +417,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestRunsInsecuredContentRandomizeHash) { // - images and scripts are filtered out entirely // Marked as flaky, see bug 40932. IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestUnsafeContents) { - scoped_refptr<HTTPSTestServer> good_https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> good_https_server = GoodCertServer(); ASSERT_TRUE(good_https_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); ui_test_utils::NavigateToURL(browser(), good_https_server->TestServerPage( @@ -454,9 +456,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestUnsafeContents) { // Visits a page with insecure content loaded by JS (after the initial page // load). IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContentLoadedFromJS) { - scoped_refptr<HTTPSTestServer> https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> https_server = GoodCertServer(); ASSERT_TRUE(https_server.get() != NULL); - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); ui_test_utils::NavigateToURL(browser(), https_server->TestServerPage( @@ -479,9 +481,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContentLoadedFromJS) { // one that doesn't. The test checks that we do not propagate the insecure // content state from one to the other. IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContentTwoTabs) { - scoped_refptr<HTTPSTestServer> https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> https_server = GoodCertServer(); ASSERT_TRUE(https_server.get() != NULL); - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); ui_test_utils::NavigateToURL(browser(), @@ -511,9 +513,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysInsecureContentTwoTabs) { // that doesn't. The test checks that we propagate the insecure content state // from one to the other. IN_PROC_BROWSER_TEST_F(SSLUITest, TestRunsInsecureContentTwoTabs) { - scoped_refptr<HTTPSTestServer> https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> https_server = GoodCertServer(); ASSERT_TRUE(https_server.get() != NULL); - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); ui_test_utils::NavigateToURL(browser(), @@ -544,9 +546,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestRunsInsecureContentTwoTabs) { // referencing that same image over http (hoping it is coming from the webcore // memory cache). IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysCachedInsecureContent) { - scoped_refptr<HTTPSTestServer> https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> https_server = GoodCertServer(); ASSERT_TRUE(https_server.get() != NULL); - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); ui_test_utils::NavigateToURL(browser(), http_server->TestServerPage( @@ -565,9 +567,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestDisplaysCachedInsecureContent) { // referencing that same script over http (hoping it is coming from the webcore // memory cache). IN_PROC_BROWSER_TEST_F(SSLUITest, TestRunsCachedInsecureContent) { - scoped_refptr<HTTPSTestServer> https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> https_server = GoodCertServer(); ASSERT_TRUE(https_server.get() != NULL); - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); ui_test_utils::NavigateToURL(browser(), @@ -593,8 +595,8 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestRunsCachedInsecureContent) { // (see bug #1044942) and that it depends on the host-name. IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestCNInvalidStickiness) { const std::string kLocalHost = "localhost"; - scoped_refptr<HTTPSTestServer> https_server = - HTTPSTestServer::CreateMismatchedServer(kDocRoot); + scoped_refptr<net::HTTPSTestServer> https_server = + net::HTTPSTestServer::CreateMismatchedServer(kDocRoot); ASSERT_TRUE(https_server.get() != NULL); // First we hit the server with hostname, this generates an invalid policy @@ -639,7 +641,7 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestCNInvalidStickiness) { // Test that navigating to a #ref does not change a bad security state. IN_PROC_BROWSER_TEST_F(SSLUITest, TestRefNavigation) { - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); ui_test_utils::NavigateToURL(browser(), @@ -668,9 +670,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestRefNavigation) { // TODO(jcampan): http://crbug.com/2136 disabled because the popup is not // opened as it is not initiated by a user gesture. IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestCloseTabWithUnsafePopup) { - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); ui_test_utils::NavigateToURL(browser(), @@ -703,9 +705,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestCloseTabWithUnsafePopup) { // Visit a page over bad https that is a redirect to a page with good https. // Marked as flaky, see bug 40932. IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestRedirectBadToGoodHTTPS) { - scoped_refptr<HTTPSTestServer> good_https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> good_https_server = GoodCertServer(); ASSERT_TRUE(good_https_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); GURL url1 = bad_https_server->TestServerPage("server-redirect?"); @@ -727,9 +729,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestRedirectBadToGoodHTTPS) { // Visit a page over good https that is a redirect to a page with bad https. // Marked as flaky, see bug 40932. IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestRedirectGoodToBadHTTPS) { - scoped_refptr<HTTPSTestServer> good_https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> good_https_server = GoodCertServer(); ASSERT_TRUE(good_https_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); GURL url1 = good_https_server->TestServerPage("server-redirect?"); @@ -748,9 +750,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestRedirectGoodToBadHTTPS) { // Visit a page over http that is a redirect to a page with good HTTPS. IN_PROC_BROWSER_TEST_F(SSLUITest, TestRedirectHTTPToGoodHTTPS) { - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); - scoped_refptr<HTTPSTestServer> good_https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> good_https_server = GoodCertServer(); ASSERT_TRUE(good_https_server.get() != NULL); TabContents* tab = browser()->GetSelectedTabContents(); @@ -767,9 +769,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestRedirectHTTPToGoodHTTPS) { // Visit a page over http that is a redirect to a page with bad HTTPS. IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestRedirectHTTPToBadHTTPS) { - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); TabContents* tab = browser()->GetSelectedTabContents(); @@ -792,9 +794,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestRedirectHTTPToBadHTTPS) { // we don't keep the secure state). // Marked as flaky, see bug 40932. IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestRedirectHTTPSToHTTP) { - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); - scoped_refptr<HTTPSTestServer> https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> https_server = GoodCertServer(); ASSERT_TRUE(https_server.get() != NULL); GURL https_url = https_server->TestServerPage("server-redirect?"); @@ -827,11 +829,11 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, TestConnectToBadPort) { // - navigate to HTTP (expect insecure content), then back // Disabled, http://crbug.com/18626. IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestGoodFrameNavigation) { - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); - scoped_refptr<HTTPSTestServer> good_https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> good_https_server = GoodCertServer(); ASSERT_TRUE(good_https_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); TabContents* tab = browser()->GetSelectedTabContents(); @@ -899,9 +901,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestGoodFrameNavigation) { // - navigate to an OK HTTPS frame (expected to be still authentication broken). // Marked as flaky, see bug 40932. IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestBadFrameNavigation) { - scoped_refptr<HTTPSTestServer> good_https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> good_https_server = GoodCertServer(); ASSERT_TRUE(good_https_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); TabContents* tab = browser()->GetSelectedTabContents(); @@ -938,11 +940,11 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestBadFrameNavigation) { FLAKY_TestUnauthenticatedFrameNavigation #endif IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestUnauthenticatedFrameNavigation) { - scoped_refptr<HTTPTestServer> http_server = PlainServer(); + scoped_refptr<net::HTTPTestServer> http_server = PlainServer(); ASSERT_TRUE(http_server.get() != NULL); - scoped_refptr<HTTPSTestServer> good_https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> good_https_server = GoodCertServer(); ASSERT_TRUE(good_https_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); TabContents* tab = browser()->GetSelectedTabContents(); @@ -986,9 +988,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, MAYBE_TestUnauthenticatedFrameNavigation) { // Marked as flaky, see bug 40932. IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestUnsafeContentsInWorkerFiltered) { - scoped_refptr<HTTPSTestServer> good_https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> good_https_server = GoodCertServer(); ASSERT_TRUE(good_https_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); // This page will spawn a Worker which will try to load content from @@ -1004,9 +1006,9 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestUnsafeContentsInWorkerFiltered) { // Marked as flaky, see bug 40932. IN_PROC_BROWSER_TEST_F(SSLUITest, FLAKY_TestUnsafeContentsInWorker) { - scoped_refptr<HTTPSTestServer> good_https_server = GoodCertServer(); + scoped_refptr<net::HTTPSTestServer> good_https_server = GoodCertServer(); ASSERT_TRUE(good_https_server.get() != NULL); - scoped_refptr<HTTPSTestServer> bad_https_server = BadCertServer(); + scoped_refptr<net::HTTPSTestServer> bad_https_server = BadCertServer(); ASSERT_TRUE(bad_https_server.get() != NULL); // Navigate to an unsafe site. Proceed with interstitial page to indicate diff --git a/chrome/browser/sync/glue/http_bridge_unittest.cc b/chrome/browser/sync/glue/http_bridge_unittest.cc index 7eeb7fd..4d065f4 100644 --- a/chrome/browser/sync/glue/http_bridge_unittest.cc +++ b/chrome/browser/sync/glue/http_bridge_unittest.cc @@ -8,6 +8,7 @@ #include "chrome/browser/sync/glue/http_bridge.h" #include "chrome/common/net/test_url_fetcher_factory.h" #include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" #include "testing/gtest/include/gtest/gtest.h" using browser_sync::HttpBridge; @@ -174,7 +175,8 @@ TEST_F(HttpBridgeTest, TestMakeSynchronousPostShunted) { // Full round-trip test of the HttpBridge, using default UA string and // no request cookies. TEST_F(HttpBridgeTest, TestMakeSynchronousPostLiveWithPayload) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<HttpBridge> http_bridge(BuildBridge()); @@ -198,7 +200,8 @@ TEST_F(HttpBridgeTest, TestMakeSynchronousPostLiveWithPayload) { // Full round-trip test of the HttpBridge, using custom UA string TEST_F(HttpBridgeTest, TestMakeSynchronousPostLiveComprehensive) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<HttpBridge> http_bridge(BuildBridge()); @@ -225,7 +228,8 @@ TEST_F(HttpBridgeTest, TestMakeSynchronousPostLiveComprehensive) { } TEST_F(HttpBridgeTest, TestExtraRequestHeaders) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<HttpBridge> http_bridge(BuildBridge()); @@ -253,7 +257,8 @@ TEST_F(HttpBridgeTest, TestExtraRequestHeaders) { } TEST_F(HttpBridgeTest, TestResponseHeader) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<HttpBridge> http_bridge(BuildBridge()); diff --git a/chrome/browser/tab_contents/view_source_uitest.cc b/chrome/browser/tab_contents/view_source_uitest.cc index 34ba3ae..41cd428 100644 --- a/chrome/browser/tab_contents/view_source_uitest.cc +++ b/chrome/browser/tab_contents/view_source_uitest.cc @@ -7,7 +7,7 @@ #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/ui/ui_test.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" namespace { @@ -37,7 +37,8 @@ class ViewSourceTest : public UITest { // set in the html was set successfully (it shouldn't because we rendered the // page in view source) TEST_F(ViewSourceTest, DoesBrowserRenderInViewSource) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); std::string cookie = "viewsource_cookie"; std::string cookie_data = "foo"; @@ -61,7 +62,8 @@ TEST_F(ViewSourceTest, DoesBrowserRenderInViewSource) { // implementation of the view-source: prefix being consumed (removed from the // 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)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); // First we navigate to google.html. @@ -80,7 +82,8 @@ TEST_F(ViewSourceTest, DoesBrowserConsumeViewSourcePrefix) { // Make sure that when looking at the actual page, we can select "View Source" // from the menu. TEST_F(ViewSourceTest, ViewSourceInMenuEnabledOnANormalPage) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL url(server->TestServerPage(test_html_)); @@ -92,7 +95,8 @@ TEST_F(ViewSourceTest, ViewSourceInMenuEnabledOnANormalPage) { // Make sure that when looking at the page source, we can't select "View Source" // from the menu. TEST_F(ViewSourceTest, ViewSourceInMenuDisabledWhileViewingSource) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL url_viewsource(chrome::kViewSourceScheme + std::string(":") + diff --git a/chrome/browser/tab_restore_uitest.cc b/chrome/browser/tab_restore_uitest.cc index 009d780..dd1bc29 100644 --- a/chrome/browser/tab_restore_uitest.cc +++ b/chrome/browser/tab_restore_uitest.cc @@ -19,7 +19,7 @@ #include "chrome/test/ui/ui_test.h" #include "googleurl/src/gurl.h" #include "net/base/net_util.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" // http://code.google.com/p/chromium/issues/detail?id=14774 #if (defined(OS_WIN) || defined(OS_CHROMEOS)) && !defined(NDEBUG) @@ -459,7 +459,8 @@ TEST_F(TabRestoreUITest, FLAKY_RestoreIntoSameWindow) { // to an existing SiteInstance. (Bug 1230446) TEST_F(TabRestoreUITest, RestoreWithExistingSiteInstance) { const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL http_url1(server->TestServerPage("files/title1.html")); GURL http_url2(server->TestServerPage("files/title2.html")); @@ -505,7 +506,8 @@ TEST_F(TabRestoreUITest, RestoreWithExistingSiteInstance) { // already exists. (Bug 1204135) TEST_F(TabRestoreUITest, RestoreCrossSiteWithExistingSiteInstance) { const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL http_url1(server->TestServerPage("files/title1.html")); GURL http_url2(server->TestServerPage("files/title2.html")); @@ -646,7 +648,8 @@ TEST_F(TabRestoreUITest, RestoreTabWithSpecialURL) { // entry and see that it loads properly. See http://crbug.com/31905 TEST_F(TabRestoreUITest, RestoreTabWithSpecialURLOnBack) { const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(server.get()); const GURL http_url(server->TestServerPage("files/title1.html")); diff --git a/chrome/browser/views/find_bar_host_interactive_uitest.cc b/chrome/browser/views/find_bar_host_interactive_uitest.cc index 82e0987..8c04ab7 100644 --- a/chrome/browser/views/find_bar_host_interactive_uitest.cc +++ b/chrome/browser/views/find_bar_host_interactive_uitest.cc @@ -14,7 +14,7 @@ #include "chrome/browser/view_ids.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" #include "views/focus/focus_manager.h" #include "views/view.h" @@ -87,7 +87,7 @@ class FindInPageTest : public InProcessBrowserTest { } // namespace IN_PROC_BROWSER_TEST_F(FindInPageTest, CrashEscHandlers) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server(net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); // First we navigate to our test page (tab A). @@ -124,7 +124,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, CrashEscHandlers) { } IN_PROC_BROWSER_TEST_F(FindInPageTest, FocusRestore) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server(net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL url = server->TestServerPage("title1.html"); @@ -173,7 +173,7 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, PrepopulateRespectBlank) { return; #endif - HTTPTestServer* server = StartHTTPServer(); + net::HTTPTestServer* server = StartHTTPServer(); ASSERT_TRUE(server); // First we navigate to any page. diff --git a/chrome/browser/views/find_bar_host_uitest.cc b/chrome/browser/views/find_bar_host_uitest.cc index 6b09cc8..a8a88ba 100644 --- a/chrome/browser/views/find_bar_host_uitest.cc +++ b/chrome/browser/views/find_bar_host_uitest.cc @@ -6,7 +6,7 @@ #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/ui/ui_test.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" class FindInPageControllerTest : public UITest { public: @@ -25,8 +25,8 @@ const std::string kSimplePage = "404_is_enough_for_us.html"; // The find window should not change its location just because we open and close // a new tab. TEST_F(FindInPageControllerTest, FindMovesOnTabClose_Issue1343052) { - scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"chrome/test/data"); + scoped_refptr<net::HTTPTestServer> server = + net::HTTPTestServer::CreateServer(L"chrome/test/data"); ASSERT_TRUE(NULL != server.get()); GURL url = server->TestServerPage(kSimplePage); diff --git a/chrome/common/net/url_fetcher_unittest.cc b/chrome/common/net/url_fetcher_unittest.cc index 4b5586a..eba4983 100644 --- a/chrome/common/net/url_fetcher_unittest.cc +++ b/chrome/common/net/url_fetcher_unittest.cc @@ -10,8 +10,8 @@ #include "chrome/common/net/url_fetcher_protect.h" #include "chrome/common/net/url_request_context_getter.h" #include "net/http/http_response_headers.h" -#include "net/test/test_server.h" #include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" #include "testing/gtest/include/gtest/gtest.h" using base::Time; @@ -431,7 +431,8 @@ void URLFetcherCancelTest::CancelRequest() { } TEST_F(URLFetcherTest, SameThreadsTest) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); // Create the fetcher on the main thread. Since IO will happen on the main @@ -443,7 +444,8 @@ TEST_F(URLFetcherTest, SameThreadsTest) { } TEST_F(URLFetcherTest, DifferentThreadsTest) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); // Create a separate thread that will create the URLFetcher. The current @@ -460,15 +462,16 @@ TEST_F(URLFetcherTest, DifferentThreadsTest) { } TEST_F(URLFetcherPostTest, Basic) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); CreateFetcher(GURL(server->TestServerPage("echo"))); MessageLoop::current()->Run(); } TEST_F(URLFetcherHeadersTest, Headers) { - scoped_refptr<HTTPTestServer> server = - HTTPTestServer::CreateServer(L"net/data/url_request_unittest"); + scoped_refptr<net::HTTPTestServer> server = + net::HTTPTestServer::CreateServer(L"net/data/url_request_unittest"); ASSERT_TRUE(NULL != server.get()); CreateFetcher(GURL(server->TestServerPage("files/with-headers.html"))); MessageLoop::current()->Run(); @@ -476,7 +479,8 @@ TEST_F(URLFetcherHeadersTest, Headers) { } TEST_F(URLFetcherProtectTest, Overload) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL url = GURL(server->TestServerPage("defaultresponse")); @@ -493,7 +497,8 @@ TEST_F(URLFetcherProtectTest, Overload) { } TEST_F(URLFetcherProtectTest, ServerUnavailable) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL url = GURL(server->TestServerPage("files/server-unavailable.html")); @@ -512,7 +517,8 @@ TEST_F(URLFetcherProtectTest, ServerUnavailable) { } TEST_F(URLFetcherProtectTestPassedThrough, ServerUnavailablePropagateResponse) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL url = GURL(server->TestServerPage("files/server-unavailable.html")); @@ -534,8 +540,8 @@ TEST_F(URLFetcherProtectTestPassedThrough, ServerUnavailablePropagateResponse) { TEST_F(URLFetcherBadHTTPSTest, BadHTTPSTest) { - scoped_refptr<HTTPSTestServer> server = - HTTPSTestServer::CreateExpiredServer(kDocRoot); + scoped_refptr<net::HTTPSTestServer> server = + net::HTTPSTestServer::CreateExpiredServer(kDocRoot); ASSERT_TRUE(NULL != server.get()); CreateFetcher(GURL(server->TestServerPage("defaultresponse"))); @@ -544,7 +550,8 @@ TEST_F(URLFetcherBadHTTPSTest, BadHTTPSTest) { } TEST_F(URLFetcherCancelTest, ReleasesContext) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL url = GURL(server->TestServerPage("files/server-unavailable.html")); @@ -570,7 +577,8 @@ TEST_F(URLFetcherCancelTest, ReleasesContext) { } TEST_F(URLFetcherCancelTest, CancelWhileDelayedStartTaskPending) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); GURL url = GURL(server->TestServerPage("files/server-unavailable.html")); diff --git a/chrome/renderer/external_extension_uitest.cc b/chrome/renderer/external_extension_uitest.cc index d883c2e..fcd19b8 100644 --- a/chrome/renderer/external_extension_uitest.cc +++ b/chrome/renderer/external_extension_uitest.cc @@ -9,7 +9,7 @@ #include "chrome/test/ui/ui_layout_test.h" #include "chrome/test/ui_test_utils.h" #include "net/base/escape.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" class SearchProviderTest : public UITest { protected: @@ -21,14 +21,14 @@ class SearchProviderTest : public UITest { const char* host, const char* expected_result); - scoped_refptr<HTTPTestServer> server_; + scoped_refptr<net::HTTPTestServer> server_; private: DISALLOW_COPY_AND_ASSIGN(SearchProviderTest); }; SearchProviderTest::SearchProviderTest() - : server_(HTTPTestServer::CreateServer(L"chrome/test/data")) { + : server_(net::HTTPTestServer::CreateServer(L"chrome/test/data")) { if (!server_) return; diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc index 342fb2f..ccdff3f 100644 --- a/chrome/test/automation/automation_proxy_uitest.cc +++ b/chrome/test/automation/automation_proxy_uitest.cc @@ -30,7 +30,7 @@ #include "chrome/test/ui/ui_test.h" #include "gfx/rect.h" #include "net/base/net_util.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #include "testing/gmock_mutant.h" #include "views/event.h" @@ -971,7 +971,8 @@ TEST_F(ExternalTabUITest, FLAKY_TabPostMessage) { TEST_F(ExternalTabUITest, FLAKY_PostMessageTarget) { const wchar_t kDocRoot[] = L"chrome/test/data/external_tab"; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_THAT(server.get(), testing::NotNull()); scoped_refptr<TabProxy> tab; diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc index f2c410d..0cbb39d 100644 --- a/chrome/test/in_process_browser_test.cc +++ b/chrome/test/in_process_browser_test.cc @@ -36,6 +36,7 @@ #include "chrome/test/testing_browser_process.h" #include "chrome/test/ui_test_utils.h" #include "net/base/mock_host_resolver.h" +#include "net/test/test_server.h" #include "sandbox/src/dep.h" #if defined(OS_LINUX) @@ -238,9 +239,9 @@ void InProcessBrowserTest::TearDown() { RenderProcessHost::set_run_renderer_in_process(original_single_process_); } -HTTPTestServer* InProcessBrowserTest::StartHTTPServer() { +net::HTTPTestServer* InProcessBrowserTest::StartHTTPServer() { DCHECK(!http_server_.get()); - http_server_ = HTTPTestServer::CreateServer( + http_server_ = net::HTTPTestServer::CreateServer( L"chrome/test/data"); return http_server_.get(); } diff --git a/chrome/test/in_process_browser_test.h b/chrome/test/in_process_browser_test.h index deaf160..eef6c94 100644 --- a/chrome/test/in_process_browser_test.h +++ b/chrome/test/in_process_browser_test.h @@ -7,12 +7,16 @@ #pragma once #include "base/compiler_specific.h" -#include "net/url_request/url_request_unittest.h" +#include "base/ref_counted.h" +#include "base/scoped_ptr.h" #include "testing/gtest/include/gtest/gtest.h" class Browser; +class CommandLine; class Profile; + namespace net { +class HTTPTestServer; class RuleBasedHostResolverProc; } @@ -98,7 +102,7 @@ class InProcessBrowserTest : public testing::Test { void SetInitialTimeoutInMS(int initial_timeout); // Starts an HTTP server. - HTTPTestServer* StartHTTPServer() WARN_UNUSED_RESULT; + net::HTTPTestServer* StartHTTPServer() WARN_UNUSED_RESULT; // Creates a browser with a single tab (about:blank), waits for the tab to // finish loading and shows the browser. @@ -133,7 +137,7 @@ class InProcessBrowserTest : public testing::Test { Browser* browser_; // HTTPServer, created when StartHTTPServer is invoked. - scoped_refptr<HTTPTestServer> http_server_; + scoped_refptr<net::HTTPTestServer> http_server_; // Whether this test requires the browser windows to be shown (interactive // tests for example need the windows shown). diff --git a/chrome/test/interactive_ui/infobars_uitest.cc b/chrome/test/interactive_ui/infobars_uitest.cc index a31513c..a57ef58 100644 --- a/chrome/test/interactive_ui/infobars_uitest.cc +++ b/chrome/test/interactive_ui/infobars_uitest.cc @@ -6,7 +6,7 @@ #include "chrome/test/automation/extension_proxy.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/ui/ui_test.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" class InfoBarsUITest : public UITest { public: @@ -17,7 +17,8 @@ class InfoBarsUITest : public UITest { TEST_F(InfoBarsUITest, TestInfoBarsCloseOnNewTheme) { const wchar_t kDocRoot[] = L"chrome/test/data"; - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(server.get() != NULL); scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); diff --git a/chrome/test/live_sync/live_sync_test.cc b/chrome/test/live_sync/live_sync_test.cc index 761aece..207eb99 100644 --- a/chrome/test/live_sync/live_sync_test.cc +++ b/chrome/test/live_sync/live_sync_test.cc @@ -7,6 +7,7 @@ #include <vector> #include "base/command_line.h" +#include "base/path_service.h" #include "base/string_util.h" #include "chrome/browser/profile.h" #include "chrome/browser/profile_manager.h" diff --git a/chrome/test/ui/ppapi_uitest.cc b/chrome/test/ui/ppapi_uitest.cc index a1b35d1..5cb4aa8 100644 --- a/chrome/test/ui/ppapi_uitest.cc +++ b/chrome/test/ui/ppapi_uitest.cc @@ -9,7 +9,7 @@ #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/ui/ui_test.h" #include "net/base/net_util.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" #include "webkit/glue/plugins/plugin_switches.h" namespace { @@ -74,8 +74,8 @@ class PPAPITest : public UITest { void RunTestViaHTTP(const std::string& test_case) { const wchar_t kDocRoot[] = L"third_party/ppapi/tests"; - scoped_refptr<HTTPTestServer> server( - HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(server); RunTestURL(server->TestServerPage("files/test_case.html?" + test_case)); } diff --git a/chrome/worker/worker_uitest.cc b/chrome/worker/worker_uitest.cc index 8453a1a..f054be4 100644 --- a/chrome/worker/worker_uitest.cc +++ b/chrome/worker/worker_uitest.cc @@ -12,7 +12,7 @@ #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/ui/ui_layout_test.h" #include "chrome/test/ui_test_utils.h" -#include "net/url_request/url_request_unittest.h" +#include "net/test/test_server.h" namespace { @@ -198,7 +198,8 @@ const wchar_t kDocRoot[] = L"chrome/test/data/workers"; #endif // Make sure that auth dialog is displayed from worker context. TEST_F(WorkerTest, WorkerHttpAuth) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<TabProxy> tab(GetActiveTab()); @@ -215,7 +216,8 @@ TEST_F(WorkerTest, WorkerHttpAuth) { #endif // Make sure that auth dialog is displayed from shared worker context. TEST_F(WorkerTest, SharedWorkerHttpAuth) { - scoped_refptr<HTTPTestServer> server(HTTPTestServer::CreateServer(kDocRoot)); + scoped_refptr<net::HTTPTestServer> server( + net::HTTPTestServer::CreateServer(kDocRoot)); ASSERT_TRUE(NULL != server.get()); scoped_refptr<TabProxy> tab(GetActiveTab()); |