summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/automation_provider.cc
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 /chrome/browser/automation/automation_provider.cc
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
Diffstat (limited to 'chrome/browser/automation/automation_provider.cc')
-rw-r--r--chrome/browser/automation/automation_provider.cc36
1 files changed, 2 insertions, 34 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 {