summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-30 15:48:53 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-30 15:48:53 +0000
commitf732c1e252e6b9f4311671c994a1207658090f20 (patch)
tree98b71691f8ee9f39f732c7b521fc011123b71c9e
parent9a7f317d31d4478fb129b1c422f7f2a2d326658d (diff)
downloadchromium_src-f732c1e252e6b9f4311671c994a1207658090f20.zip
chromium_src-f732c1e252e6b9f4311671c994a1207658090f20.tar.gz
chromium_src-f732c1e252e6b9f4311671c994a1207658090f20.tar.bz2
Move mock url request classes to a location when browser tests will be able to use them too.
TEST=none BUG=none Review URL: http://codereview.chromium.org/160366 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22056 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/automation/automation_provider.cc36
-rw-r--r--chrome/browser/download/download_uitest.cc4
-rw-r--r--chrome/browser/download/save_page_uitest.cc2
-rw-r--r--chrome/browser/errorpage_uitest.cc2
-rw-r--r--chrome/browser/net/url_request_failed_dns_job.cc (renamed from chrome/browser/automation/url_request_failed_dns_job.cc)4
-rw-r--r--chrome/browser/net/url_request_failed_dns_job.h (renamed from chrome/browser/automation/url_request_failed_dns_job.h)10
-rw-r--r--chrome/browser/net/url_request_mock_http_job.cc (renamed from chrome/browser/automation/url_request_mock_http_job.cc)4
-rw-r--r--chrome/browser/net/url_request_mock_http_job.h (renamed from chrome/browser/automation/url_request_mock_http_job.h)10
-rw-r--r--chrome/browser/net/url_request_mock_net_error_job.cc (renamed from chrome/browser/automation/url_request_mock_net_error_job.cc)2
-rw-r--r--chrome/browser/net/url_request_mock_net_error_job.h (renamed from chrome/browser/automation/url_request_mock_net_error_job.h)8
-rw-r--r--chrome/browser/net/url_request_mock_util.cc64
-rw-r--r--chrome/browser/net/url_request_mock_util.h17
-rw-r--r--chrome/browser/net/url_request_slow_download_job.cc (renamed from chrome/browser/automation/url_request_slow_download_job.cc)4
-rw-r--r--chrome/browser/net/url_request_slow_download_job.h (renamed from chrome/browser/automation/url_request_slow_download_job.h)10
-rw-r--r--chrome/browser/net/url_request_slow_http_job.cc (renamed from chrome/browser/automation/url_request_slow_http_job.cc)4
-rw-r--r--chrome/browser/net/url_request_slow_http_job.h (renamed from chrome/browser/automation/url_request_slow_http_job.h)12
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc4
-rw-r--r--chrome/browser/unload_uitest.cc2
-rw-r--r--chrome/chrome.gyp30
-rw-r--r--chrome/test/automation/automation_proxy_uitest.cc2
20 files changed, 141 insertions, 90 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index ecfcc96..3330b7d 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -21,10 +21,6 @@
#include "chrome/browser/automation/automation_provider_list.h"
#include "chrome/browser/automation/extension_automation_constants.h"
#include "chrome/browser/automation/extension_port_container.h"
-#include "chrome/browser/automation/url_request_failed_dns_job.h"
-#include "chrome/browser/automation/url_request_mock_http_job.h"
-#include "chrome/browser/automation/url_request_slow_download_job.h"
-#include "chrome/browser/automation/url_request_slow_http_job.h"
#include "chrome/browser/blocked_popup_container.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_window.h"
@@ -37,6 +33,7 @@
#include "chrome/browser/find_bar_controller.h"
#include "chrome/browser/find_notification_details.h"
#include "chrome/browser/location_bar.h"
+#include "chrome/browser/net/url_request_mock_util.h"
#include "chrome/browser/profile_manager.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/ssl/ssl_manager.h"
@@ -53,7 +50,6 @@
#include "net/proxy/proxy_service.h"
#include "net/proxy/proxy_config_service_fixed.h"
#include "net/url_request/url_request_context.h"
-#include "net/url_request/url_request_filter.h"
#if defined(OS_WIN)
// TODO(port): Port these headers.
@@ -2111,37 +2107,9 @@ void AutomationProvider::ReceivedInspectElementResponse(int num_resources) {
}
}
-// Helper class for making changes to the URLRequest ProtocolFactory on the
-// IO thread.
-class SetFilteredInetTask : public Task {
- public:
- explicit SetFilteredInetTask(bool enabled) : enabled_(enabled) { }
- virtual void Run() {
- if (enabled_) {
- URLRequestFilter::GetInstance()->ClearHandlers();
-
- URLRequestFailedDnsJob::AddUITestUrls();
- URLRequestSlowDownloadJob::AddUITestUrls();
-
- std::wstring root_http;
- PathService::Get(chrome::DIR_TEST_DATA, &root_http);
- URLRequestMockHTTPJob::AddUITestUrls(root_http);
- URLRequestSlowHTTPJob::AddUITestUrls(root_http);
- } else {
- // Revert to the default handlers.
- URLRequestFilter::GetInstance()->ClearHandlers();
- }
- }
- private:
- bool enabled_;
-};
-
void AutomationProvider::SetFilteredInet(const IPC::Message& message,
bool enabled) {
- // Since this involves changing the URLRequest ProtocolFactory, we want to
- // run on the main thread.
- g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
- new SetFilteredInetTask(enabled));
+ chrome_browser_net::SetUrlRequestMocksEnabled(enabled);
}
class SetProxyConfigTask : public Task {
diff --git a/chrome/browser/download/download_uitest.cc b/chrome/browser/download/download_uitest.cc
index 14421d0..5ecfde3 100644
--- a/chrome/browser/download/download_uitest.cc
+++ b/chrome/browser/download/download_uitest.cc
@@ -16,8 +16,8 @@
#include "base/platform_thread.h"
#include "base/string_util.h"
#include "chrome/app/chrome_dll_resource.h"
-#include "chrome/browser/automation/url_request_mock_http_job.h"
-#include "chrome/browser/automation/url_request_slow_download_job.h"
+#include "chrome/browser/net/url_request_mock_http_job.h"
+#include "chrome/browser/net/url_request_slow_download_job.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
diff --git a/chrome/browser/download/save_page_uitest.cc b/chrome/browser/download/save_page_uitest.cc
index 503cf66..cca1cab 100644
--- a/chrome/browser/download/save_page_uitest.cc
+++ b/chrome/browser/download/save_page_uitest.cc
@@ -7,7 +7,7 @@
#include "base/platform_thread.h"
#include "base/string_util.h"
#include "chrome/app/chrome_dll_resource.h"
-#include "chrome/browser/automation/url_request_mock_http_job.h"
+#include "chrome/browser/net/url_request_mock_http_job.h"
#include "chrome/browser/download/save_package.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/automation/browser_proxy.h"
diff --git a/chrome/browser/errorpage_uitest.cc b/chrome/browser/errorpage_uitest.cc
index ff604d1..9b2c489 100644
--- a/chrome/browser/errorpage_uitest.cc
+++ b/chrome/browser/errorpage_uitest.cc
@@ -4,7 +4,7 @@
#include "base/string_util.h"
#include "chrome/test/ui/ui_test.h"
-#include "chrome/browser/automation/url_request_failed_dns_job.h"
+#include "chrome/browser/net/url_request_failed_dns_job.h"
#include "net/url_request/url_request_unittest.h"
class ErrorPageTest : public UITest {
diff --git a/chrome/browser/automation/url_request_failed_dns_job.cc b/chrome/browser/net/url_request_failed_dns_job.cc
index f71c0c8..e436204 100644
--- a/chrome/browser/automation/url_request_failed_dns_job.cc
+++ b/chrome/browser/net/url_request_failed_dns_job.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/automation/url_request_failed_dns_job.h"
+#include "chrome/browser/net/url_request_failed_dns_job.h"
#include "base/message_loop.h"
#include "googleurl/src/gurl.h"
@@ -19,7 +19,7 @@ void URLRequestFailedDnsJob::Start() {
}
/* static */
-void URLRequestFailedDnsJob::AddUITestUrls() {
+void URLRequestFailedDnsJob::AddUrlHandler() {
URLRequestFilter* filter = URLRequestFilter::GetInstance();
filter->AddUrlHandler(GURL(kTestUrl),
&URLRequestFailedDnsJob::Factory);
diff --git a/chrome/browser/automation/url_request_failed_dns_job.h b/chrome/browser/net/url_request_failed_dns_job.h
index ee10e5e..b1abc87 100644
--- a/chrome/browser/automation/url_request_failed_dns_job.h
+++ b/chrome/browser/net/url_request_failed_dns_job.h
@@ -3,8 +3,8 @@
// found in the LICENSE file.
// This class simulates what wininet does when a dns lookup fails.
-#ifndef CHROME_BROWSER_AUTOMATION_URL_REQUEST_FAILED_DNS_JOB_H__
-#define CHROME_BROWSER_AUTOMATION_URL_REQUEST_FAILED_DNS_JOB_H__
+#ifndef CHROME_BROWSER_NET_URL_REQUEST_FAILED_DNS_JOB_H_
+#define CHROME_BROWSER_NET_URL_REQUEST_FAILED_DNS_JOB_H_
#include "net/url_request/url_request_job.h"
@@ -21,12 +21,12 @@ class URLRequestFailedDnsJob : public URLRequestJob {
// A test URL that can be used in UI tests.
static const char kTestUrl[];
- // For UI tests: adds the testing URLs to the URLRequestFilter.
- static void AddUITestUrls();
+ // Adds the testing URLs to the URLRequestFilter.
+ static void AddUrlHandler();
private:
// Simulate a DNS failure.
void StartAsync();
};
-#endif // CHROME_BROWSER_AUTOMATION_URL_REQUEST_FAILED_DNS_JOB_H__
+#endif // CHROME_BROWSER_NET_URL_REQUEST_FAILED_DNS_JOB_H_
diff --git a/chrome/browser/automation/url_request_mock_http_job.cc b/chrome/browser/net/url_request_mock_http_job.cc
index 4d212a5..fc654be 100644
--- a/chrome/browser/automation/url_request_mock_http_job.cc
+++ b/chrome/browser/net/url_request_mock_http_job.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/automation/url_request_mock_http_job.h"
+#include "chrome/browser/net/url_request_mock_http_job.h"
#include "base/file_util.h"
#include "base/message_loop.h"
@@ -24,7 +24,7 @@ URLRequestJob* URLRequestMockHTTPJob::Factory(URLRequest* request,
}
/* static */
-void URLRequestMockHTTPJob::AddUITestUrls(const std::wstring& base_path) {
+void URLRequestMockHTTPJob::AddUrlHandler(const std::wstring& base_path) {
base_path_ = base_path;
// Add kMockHostname to URLRequestFilter.
diff --git a/chrome/browser/automation/url_request_mock_http_job.h b/chrome/browser/net/url_request_mock_http_job.h
index 2a7de09..36e6acb 100644
--- a/chrome/browser/automation/url_request_mock_http_job.h
+++ b/chrome/browser/net/url_request_mock_http_job.h
@@ -4,8 +4,8 @@
//
// A URLRequestJob class that pulls the content and http headers from disk.
-#ifndef CHROME_BROWSER_AUTOMATION_URL_REQUEST_MOCK_HTTP_JOB_H__
-#define CHROME_BROWSER_AUTOMATION_URL_REQUEST_MOCK_HTTP_JOB_H__
+#ifndef CHROME_BROWSER_NET_URL_REQUEST_MOCK_HTTP_JOB_H_
+#define CHROME_BROWSER_NET_URL_REQUEST_MOCK_HTTP_JOB_H_
#include <string>
@@ -22,8 +22,8 @@ class URLRequestMockHTTPJob : public URLRequestFileJob {
static URLRequest::ProtocolFactory Factory;
- // For UI tests: adds the testing URLs to the URLRequestFilter.
- static void AddUITestUrls(const std::wstring& base_path);
+ // Adds the testing URLs to the URLRequestFilter.
+ static void AddUrlHandler(const std::wstring& base_path);
// Given the path to a file relative to base_path_, construct a mock URL.
static GURL GetMockUrl(const std::wstring& path);
@@ -41,4 +41,4 @@ class URLRequestMockHTTPJob : public URLRequestFileJob {
static std::wstring base_path_;
};
-# endif // CHROME_BROWSER_AUTOMATION_URL_REQUEST_MOCK_HTTP_JOB_H__
+# endif // CHROME_BROWSER_NET_URL_REQUEST_MOCK_HTTP_JOB_H_
diff --git a/chrome/browser/automation/url_request_mock_net_error_job.cc b/chrome/browser/net/url_request_mock_net_error_job.cc
index dffbcd8..8441f6a 100644
--- a/chrome/browser/automation/url_request_mock_net_error_job.cc
+++ b/chrome/browser/net/url_request_mock_net_error_job.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/automation/url_request_mock_net_error_job.h"
+#include "chrome/browser/net/url_request_mock_net_error_job.h"
#include "base/file_util.h"
#include "base/message_loop.h"
diff --git a/chrome/browser/automation/url_request_mock_net_error_job.h b/chrome/browser/net/url_request_mock_net_error_job.h
index 6f082ae..8a7c87c 100644
--- a/chrome/browser/automation/url_request_mock_net_error_job.h
+++ b/chrome/browser/net/url_request_mock_net_error_job.h
@@ -6,10 +6,10 @@
// related).
// It is based on URLRequestMockHttpJob.
-#ifndef CHROME_BROWSER_AUTOMATION_URL_REQUEST_MOCK_NET_ERROR_H__
-#define CHROME_BROWSER_AUTOMATION_URL_REQUEST_MOCK_NET_ERROR_H__
+#ifndef CHROME_BROWSER_NET_URL_REQUEST_MOCK_NET_ERROR_H_
+#define CHROME_BROWSER_NET_URL_REQUEST_MOCK_NET_ERROR_H_
-#include "chrome/browser/automation/url_request_mock_http_job.h"
+#include "chrome/browser/net/url_request_mock_http_job.h"
class URLRequestMockNetErrorJob : public URLRequestMockHTTPJob {
public:
@@ -67,4 +67,4 @@ class URLRequestMockNetErrorJob : public URLRequestMockHTTPJob {
DISALLOW_EVIL_CONSTRUCTORS(URLRequestMockNetErrorJob);
};
-#endif // #define CHROME_BROWSER_AUTOMATION_URL_REQUEST_MOCK_NET_ERROR_H__
+#endif // #define CHROME_BROWSER_NET_URL_REQUEST_MOCK_NET_ERROR_H_
diff --git a/chrome/browser/net/url_request_mock_util.cc b/chrome/browser/net/url_request_mock_util.cc
new file mode 100644
index 0000000..ad0ed09
--- /dev/null
+++ b/chrome/browser/net/url_request_mock_util.cc
@@ -0,0 +1,64 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/net/url_request_mock_util.h"
+
+#include <string>
+
+#include "base/message_loop.h"
+#include "base/path_service.h"
+#include "base/task.h"
+#include "base/thread.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/net/url_request_failed_dns_job.h"
+#include "chrome/browser/net/url_request_mock_http_job.h"
+#include "chrome/browser/net/url_request_slow_download_job.h"
+#include "chrome/browser/net/url_request_slow_http_job.h"
+#include "chrome/common/chrome_paths.h"
+#include "net/url_request/url_request_filter.h"
+
+namespace {
+
+// Helper class for making changes to the URLRequest ProtocolFactory on the
+// IO thread.
+class SetUrlRequestMocksEnabledTask : public Task {
+ public:
+ explicit SetUrlRequestMocksEnabledTask(bool enabled) : enabled_(enabled) {
+ }
+
+ virtual void Run() {
+ if (enabled_) {
+ URLRequestFilter::GetInstance()->ClearHandlers();
+
+ URLRequestFailedDnsJob::AddUrlHandler();
+ URLRequestSlowDownloadJob::AddUrlHandler();
+
+ std::wstring root_http;
+ PathService::Get(chrome::DIR_TEST_DATA, &root_http);
+ URLRequestMockHTTPJob::AddUrlHandler(root_http);
+ URLRequestSlowHTTPJob::AddUrlHandler(root_http);
+ } else {
+ // Revert to the default handlers.
+ URLRequestFilter::GetInstance()->ClearHandlers();
+ }
+ }
+
+ private:
+ bool enabled_;
+
+ DISALLOW_COPY_AND_ASSIGN(SetUrlRequestMocksEnabledTask);
+};
+
+} // namespace
+
+namespace chrome_browser_net {
+
+void SetUrlRequestMocksEnabled(bool enabled) {
+ // Since this involves changing the URLRequest ProtocolFactory, we want to
+ // run on the IO thread.
+ g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
+ new SetUrlRequestMocksEnabledTask(enabled));
+}
+
+} // namespace chrome_browser_net
diff --git a/chrome/browser/net/url_request_mock_util.h b/chrome/browser/net/url_request_mock_util.h
new file mode 100644
index 0000000..b3a81bb
--- /dev/null
+++ b/chrome/browser/net/url_request_mock_util.h
@@ -0,0 +1,17 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_NET_URL_REQUEST_MOCK_UTIL_H_
+#define CHROME_BROWSER_NET_URL_REQUEST_MOCK_UTIL_H_
+
+// You should use routines in this file only for test code!
+
+namespace chrome_browser_net {
+
+// Enables or disables url request filters for mocked url requests.
+void SetUrlRequestMocksEnabled(bool enabled);
+
+} // namespace chrome_browser_net
+
+#endif // CHROME_BROWSER_NET_URL_REQUEST_MOCK_UTIL_H_
diff --git a/chrome/browser/automation/url_request_slow_download_job.cc b/chrome/browser/net/url_request_slow_download_job.cc
index 76857f8..93768ec 100644
--- a/chrome/browser/automation/url_request_slow_download_job.cc
+++ b/chrome/browser/net/url_request_slow_download_job.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/automation/url_request_slow_download_job.h"
+#include "chrome/browser/net/url_request_slow_download_job.h"
#include "base/message_loop.h"
#include "base/string_util.h"
@@ -31,7 +31,7 @@ void URLRequestSlowDownloadJob::Start() {
}
/* static */
-void URLRequestSlowDownloadJob::AddUITestUrls() {
+void URLRequestSlowDownloadJob::AddUrlHandler() {
URLRequestFilter* filter = URLRequestFilter::GetInstance();
filter->AddUrlHandler(GURL(kUnknownSizeUrl),
&URLRequestSlowDownloadJob::Factory);
diff --git a/chrome/browser/automation/url_request_slow_download_job.h b/chrome/browser/net/url_request_slow_download_job.h
index eee858a..49785a8 100644
--- a/chrome/browser/automation/url_request_slow_download_job.h
+++ b/chrome/browser/net/url_request_slow_download_job.h
@@ -5,8 +5,8 @@
// download manager. Requests to |kUnknownSizeUrl| and |kKnownSizeUrl| start
// downloads that pause after the first
-#ifndef CHROME_BROWSER_AUTOMATION_URL_REQUEST_SLOW_DOWNLOAD_JOB_H__
-#define CHROME_BROWSER_AUTOMATION_URL_REQUEST_SLOW_DOWNLOAD_JOB_H__
+#ifndef CHROME_BROWSER_NET_URL_REQUEST_SLOW_DOWNLOAD_JOB_H_
+#define CHROME_BROWSER_NET_URL_REQUEST_SLOW_DOWNLOAD_JOB_H_
#include <string>
#include <vector>
@@ -36,8 +36,8 @@ class URLRequestSlowDownloadJob : public URLRequestJob {
static const char kKnownSizeUrl[];
static const char kFinishDownloadUrl[];
- // For UI tests: adds the testing URLs to the URLRequestFilter.
- static void AddUITestUrls();
+ // Adds the testing URLs to the URLRequestFilter.
+ static void AddUrlHandler();
private:
void GetResponseInfoConst(net::HttpResponseInfo* info) const;
@@ -56,4 +56,4 @@ class URLRequestSlowDownloadJob : public URLRequestJob {
bool should_send_second_chunk_;
};
-#endif // CHROME_BROWSER_AUTOMATION_URL_REQUEST_SLOW_DOWNLOAD_JOB_H__
+#endif // CHROME_BROWSER_NET_URL_REQUEST_SLOW_DOWNLOAD_JOB_H_
diff --git a/chrome/browser/automation/url_request_slow_http_job.cc b/chrome/browser/net/url_request_slow_http_job.cc
index 30d9dfa..02a3b2b 100644
--- a/chrome/browser/automation/url_request_slow_http_job.cc
+++ b/chrome/browser/net/url_request_slow_http_job.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/automation/url_request_slow_http_job.h"
+#include "chrome/browser/net/url_request_slow_http_job.h"
#include "base/platform_thread.h"
#include "base/string_util.h"
@@ -26,7 +26,7 @@ URLRequestJob* URLRequestSlowHTTPJob::Factory(URLRequest* request,
}
/* static */
-void URLRequestSlowHTTPJob::AddUITestUrls(const std::wstring& base_path) {
+void URLRequestSlowHTTPJob::AddUrlHandler(const std::wstring& base_path) {
base_path_ = base_path;
// Add kMockHostname to URLRequestFilter.
diff --git a/chrome/browser/automation/url_request_slow_http_job.h b/chrome/browser/net/url_request_slow_http_job.h
index 6048287..d51e2d2 100644
--- a/chrome/browser/automation/url_request_slow_http_job.h
+++ b/chrome/browser/net/url_request_slow_http_job.h
@@ -4,13 +4,13 @@
//
// A URLRequestMockHTTPJob class that inserts a time delay in processing.
-#ifndef CHROME_BROWSER_AUTOMATION_URL_REQUEST_SLOW_HTTP_JOB_H_
-#define CHROME_BROWSER_AUTOMATION_URL_REQUEST_SLOW_HTTP_JOB_H_
+#ifndef CHROME_BROWSER_NET_URL_REQUEST_SLOW_HTTP_JOB_H_
+#define CHROME_BROWSER_NET_URL_REQUEST_SLOW_HTTP_JOB_H_
#include <string>
#include "base/timer.h"
-#include "chrome/browser/automation/url_request_mock_http_job.h"
+#include "chrome/browser/net/url_request_mock_http_job.h"
class URLRequestSlowHTTPJob : public URLRequestMockHTTPJob {
public:
@@ -20,8 +20,8 @@ class URLRequestSlowHTTPJob : public URLRequestMockHTTPJob {
static URLRequest::ProtocolFactory Factory;
- // For UI tests: adds the testing URLs to the URLRequestFilter.
- static void AddUITestUrls(const std::wstring& base_path);
+ // Adds the testing URLs to the URLRequestFilter.
+ static void AddUrlHandler(const std::wstring& base_path);
// Given the path to a file relative to base_path_, construct a mock URL.
static GURL GetMockUrl(const std::wstring& path);
@@ -38,4 +38,4 @@ class URLRequestSlowHTTPJob : public URLRequestMockHTTPJob {
static std::wstring base_path_;
};
-# endif // CHROME_BROWSER_AUTOMATION_URL_REQUEST_SLOW_HTTP_JOB_H_
+# endif // CHROME_BROWSER_NET_URL_REQUEST_SLOW_HTTP_JOB_H_
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
index 3cd1f88..c13d3c2 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
@@ -9,8 +9,8 @@
#include "base/file_path.h"
#include "base/path_service.h"
#include "base/string_util.h"
-#include "chrome/browser/automation/url_request_failed_dns_job.h"
-#include "chrome/browser/automation/url_request_mock_http_job.h"
+#include "chrome/browser/net/url_request_failed_dns_job.h"
+#include "chrome/browser/net/url_request_mock_http_job.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/automation/browser_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
diff --git a/chrome/browser/unload_uitest.cc b/chrome/browser/unload_uitest.cc
index 1547ccb..f712528 100644
--- a/chrome/browser/unload_uitest.cc
+++ b/chrome/browser/unload_uitest.cc
@@ -5,7 +5,7 @@
#include "app/message_box_flags.h"
#include "base/file_util.h"
#include "base/platform_thread.h"
-#include "chrome/browser/automation/url_request_mock_http_job.h"
+#include "chrome/browser/net/url_request_mock_http_job.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/test/automation/browser_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 8a31160..930c848 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -644,16 +644,6 @@
'browser/automation/extension_port_container.h',
'browser/automation/ui_controls.cc',
'browser/automation/ui_controls.h',
- 'browser/automation/url_request_failed_dns_job.cc',
- 'browser/automation/url_request_failed_dns_job.h',
- # TODO: These should be moved to test_support (see below), but
- # are currently used by production code in automation_provider.cc.
- 'browser/automation/url_request_mock_http_job.cc',
- 'browser/automation/url_request_mock_http_job.h',
- 'browser/automation/url_request_slow_download_job.cc',
- 'browser/automation/url_request_slow_download_job.h',
- 'browser/automation/url_request_slow_http_job.cc',
- 'browser/automation/url_request_slow_http_job.h',
'browser/back_forward_menu_model.cc',
'browser/back_forward_menu_model.h',
'browser/back_forward_menu_model_views.cc',
@@ -1331,6 +1321,18 @@
'browser/net/url_fetcher_protect.h',
'browser/net/url_fixer_upper.cc',
'browser/net/url_fixer_upper.h',
+ 'browser/net/url_request_failed_dns_job.cc',
+ 'browser/net/url_request_failed_dns_job.h',
+ # TODO: These should be moved to test_support (see below), but
+ # are currently used by production code in automation_provider.cc.
+ 'browser/net/url_request_mock_http_job.cc',
+ 'browser/net/url_request_mock_http_job.h',
+ 'browser/net/url_request_mock_util.cc',
+ 'browser/net/url_request_mock_util.h',
+ 'browser/net/url_request_slow_download_job.cc',
+ 'browser/net/url_request_slow_download_job.h',
+ 'browser/net/url_request_slow_http_job.cc',
+ 'browser/net/url_request_slow_http_job.h',
'browser/omnibox_search_hint.cc',
'browser/omnibox_search_hint.h',
'browser/options_page_base.cc',
@@ -3378,10 +3380,10 @@
'sources': [
# TODO: these should live here but are currently used by
# production code code in libbrowser (above).
- #'browser/automation/url_request_mock_http_job.cc',
- #'browser/automation/url_request_mock_http_job.h',
- 'browser/automation/url_request_mock_net_error_job.cc',
- 'browser/automation/url_request_mock_net_error_job.h',
+ #'browser/net/url_request_mock_http_job.cc',
+ #'browser/net/url_request_mock_http_job.h',
+ 'browser/net/url_request_mock_net_error_job.cc',
+ 'browser/net/url_request_mock_net_error_job.h',
'browser/renderer_host/mock_render_process_host.cc',
'browser/renderer_host/mock_render_process_host.h',
'browser/renderer_host/test/test_render_view_host.cc',
diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc
index 943d90c..02e77f7 100644
--- a/chrome/test/automation/automation_proxy_uitest.cc
+++ b/chrome/test/automation/automation_proxy_uitest.cc
@@ -12,7 +12,7 @@
#include "base/string_util.h"
#include "build/build_config.h"
#include "chrome/app/chrome_dll_resource.h"
-#include "chrome/browser/automation/url_request_slow_http_job.h"
+#include "chrome/browser/net/url_request_slow_http_job.h"
#include "chrome/browser/view_ids.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"