diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-05 19:43:23 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-05 19:43:23 +0000 |
commit | 02f878b7e28bd92fc7a75969a072bc81c2a2c8d6 (patch) | |
tree | d3ee445a18b316ec7faeb51058bf704308acdf1e | |
parent | a7e1e37156a8fea06e32742aab4a7d2f0d617993 (diff) | |
download | chromium_src-02f878b7e28bd92fc7a75969a072bc81c2a2c8d6.zip chromium_src-02f878b7e28bd92fc7a75969a072bc81c2a2c8d6.tar.gz chromium_src-02f878b7e28bd92fc7a75969a072bc81c2a2c8d6.tar.bz2 |
Remove the test URLRequestJobs from shipping code to just browser_tests. All the tests that used them which were ui_tests have been converted to browser_tests, so we don't need this in automation anymore.
BUG=121574
Review URL: https://chromiumcodereview.appspot.com/10538014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140588 0039d316-1c4b-4281-b951-d872f2087c98
20 files changed, 27 insertions, 74 deletions
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index ebd6881..e9d2a50 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -242,7 +242,6 @@ class AutomationProvider bool press_escape_en_route, IPC::Message* reply_message); void HandleUnused(const IPC::Message& message, int handle); - void SetFilteredInet(const IPC::Message& message, bool enabled); void GetFilteredInetHitCount(int* hit_count); void SetProxyConfig(const std::string& new_proxy_config); diff --git a/chrome/browser/automation/automation_resource_message_filter.cc b/chrome/browser/automation/automation_resource_message_filter.cc index 81bee9d..7c5d15d 100644 --- a/chrome/browser/automation/automation_resource_message_filter.cc +++ b/chrome/browser/automation/automation_resource_message_filter.cc @@ -145,8 +145,6 @@ bool AutomationResourceMessageFilter::OnMessageReceived( IPC_BEGIN_MESSAGE_MAP_EX(AutomationResourceMessageFilter, message, deserialize_success) - IPC_MESSAGE_HANDLER(AutomationMsg_SetFilteredInet, - OnSetFilteredInet) IPC_MESSAGE_HANDLER(AutomationMsg_GetCookiesHostResponse, OnGetCookiesHostResponse) IPC_MESSAGE_UNHANDLED(handled = false) @@ -377,10 +375,6 @@ bool AutomationResourceMessageFilter::SendDownloadRequestToHost( automation_request_id)); } -void AutomationResourceMessageFilter::OnSetFilteredInet(bool enable) { - //chrome_browser_net::SetUrlRequestMocksEnabled(enable); -} - bool AutomationResourceMessageFilter::ShouldFilterCookieMessages( int render_process_id, int render_view_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); diff --git a/chrome/browser/automation/automation_resource_message_filter.h b/chrome/browser/automation/automation_resource_message_filter.h index dec1544..201211d 100644 --- a/chrome/browser/automation/automation_resource_message_filter.h +++ b/chrome/browser/automation/automation_resource_message_filter.h @@ -148,8 +148,6 @@ class AutomationResourceMessageFilter AutomationResourceMessageFilter* filter); private: - void OnSetFilteredInet(bool enable); - // Resumes pending jobs from the old AutomationResourceMessageFilter instance // passed in. static void ResumeJobsForPendingView( diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 5c8c6ff..9203ac4 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -1433,12 +1433,6 @@ 'browser/net/url_fixer_upper.h', 'browser/net/url_info.cc', 'browser/net/url_info.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_link_doctor_job.cc', - 'browser/net/url_request_mock_link_doctor_job.h', - 'browser/net/url_request_mock_util.cc', - 'browser/net/url_request_mock_util.h', 'browser/notifications/balloon.cc', 'browser/notifications/balloon.h', 'browser/notifications/balloon_collection.cc', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 5b90978..f7cd6cf 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -140,6 +140,10 @@ 'browser/mock_browsing_data_quota_helper.h', 'browser/mock_browsing_data_server_bound_cert_helper.cc', 'browser/mock_browsing_data_server_bound_cert_helper.h', + 'browser/net/url_request_mock_link_doctor_job.cc', + 'browser/net/url_request_mock_link_doctor_job.h', + 'browser/net/url_request_mock_util.cc', + 'browser/net/url_request_mock_util.h', 'browser/notifications/notification_test_util.cc', 'browser/notifications/notification_test_util.h', 'browser/password_manager/mock_password_store.cc', diff --git a/chrome/common/automation_messages_internal.h b/chrome/common/automation_messages_internal.h index 8acfc95..a392400 100644 --- a/chrome/common/automation_messages_internal.h +++ b/chrome/common/automation_messages_internal.h @@ -214,7 +214,7 @@ IPC_MESSAGE_CONTROL1(AutomationMsg_InitialNewTabUILoadComplete, int /* time */) // This tells the browser to enable or disable the filtered network layer. -IPC_MESSAGE_CONTROL1(AutomationMsg_SetFilteredInet, +IPC_MESSAGE_CONTROL1(AutomationMsg_DEPRECATED_SetFilteredInet, bool /* enabled */) // Gets the directory that downloads will occur in for the active profile. diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc index c9cefcb..807b6bb 100644 --- a/chrome/test/automation/automation_proxy.cc +++ b/chrome/test/automation/automation_proxy.cc @@ -299,10 +299,6 @@ bool AutomationProxy::GetMetricEventDuration(const std::string& event_name, duration_ms)); } -bool AutomationProxy::SetFilteredInet(bool enabled) { - return Send(new AutomationMsg_SetFilteredInet(enabled)); -} - bool AutomationProxy::SendProxyConfig(const std::string& new_proxy_config) { return Send(new AutomationMsg_SetProxyConfig(new_proxy_config)); } diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h index 3263b66..63e9421 100644 --- a/chrome/test/automation/automation_proxy.h +++ b/chrome/test/automation/automation_proxy.h @@ -145,10 +145,6 @@ class AutomationProxy : public IPC::Channel::Listener, // On failure, returns NULL. scoped_refptr<WindowProxy> GetActiveWindow(); - // Tells the browser to enable or disable network request filtering. Returns - // false if the message fails to send to the browser. - bool SetFilteredInet(bool enabled) WARN_UNUSED_RESULT; - // Sends the browser a new proxy configuration to start using. Returns true // if the proxy config was successfully sent, false otherwise. bool SendProxyConfig(const std::string& new_proxy_config) WARN_UNUSED_RESULT; diff --git a/chrome/test/automation/proxy_launcher.cc b/chrome/test/automation/proxy_launcher.cc index 30bcfb4..c86c8b1 100644 --- a/chrome/test/automation/proxy_launcher.cc +++ b/chrome/test/automation/proxy_launcher.cc @@ -123,11 +123,6 @@ bool ProxyLauncher::WaitForBrowserLaunch(bool wait_for_initial_loads) { #endif } - if (!automation()->SetFilteredInet(ShouldFilterInet())) { - LOG(ERROR) << "SetFilteredInet failed."; - return false; - } - return true; } @@ -227,8 +222,6 @@ void ProxyLauncher::QuitBrowser() { base::TimeTicks quit_start = base::TimeTicks::Now(); - EXPECT_TRUE(automation()->SetFilteredInet(false)); - if (WINDOW_CLOSE == shutdown_type_) { int window_count = 0; EXPECT_TRUE(automation()->GetBrowserWindowCount(&window_count)); @@ -292,7 +285,6 @@ void ProxyLauncher::TerminateBrowser() { base::TimeTicks quit_start = base::TimeTicks::Now(); - EXPECT_TRUE(automation()->SetFilteredInet(false)); #if defined(OS_WIN) && !defined(USE_AURA) scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); diff --git a/chrome/test/automation/proxy_launcher.h b/chrome/test/automation/proxy_launcher.h index c2f03a0..d6886e1 100644 --- a/chrome/test/automation/proxy_launcher.h +++ b/chrome/test/automation/proxy_launcher.h @@ -144,10 +144,6 @@ class ProxyLauncher { // Disconnects the testing IPC from the browser. void DisconnectFromRunningBrowser(); - virtual bool ShouldFilterInet() { - return true; - } - private: bool WaitForBrowserLaunch(bool wait_for_initial_loads) WARN_UNUSED_RESULT; diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index eef01e5..177e112 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -163,10 +163,6 @@ ProxyLauncher::LaunchState UITestBase::DefaultLaunchState() { return state; } -bool UITestBase::ShouldFilterInet() { - return true; -} - void UITestBase::SetLaunchSwitches() { // All flags added here should also be added in ExtraChromeFlags() in // chrome/test/pyautolib/pyauto.py as well to take effect for all tests diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index 7748e30..b7d8968 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -265,8 +265,6 @@ class UITestBase { ProxyLauncher::LaunchState DefaultLaunchState(); - virtual bool ShouldFilterInet(); - // Extra command-line switches that need to be passed to the browser are // added in this function. Add new command-line switches here. virtual void SetLaunchSwitches(); diff --git a/chrome/test/webdriver/webdriver_automation.cc b/chrome/test/webdriver/webdriver_automation.cc index 169224d..3af0033 100644 --- a/chrome/test/webdriver/webdriver_automation.cc +++ b/chrome/test/webdriver/webdriver_automation.cc @@ -253,13 +253,9 @@ IPC::Message* BackwardsCompatAutomationMessageFilter::Rewrite( // If we're not using an old version, don't rewrite the message. if (!old_version_) return message; - const uint32 kOldSetFilteredInetType = 287, - kOldSendJSONRequestType = 1301; + const uint32 kOldSendJSONRequestType = 1301; int type = -1; switch (message->type()) { - case AutomationMsg_SetFilteredInet::ID: - type = kOldSetFilteredInetType; - break; case AutomationMsg_SendJSONRequest::ID: type = kOldSendJSONRequestType; break; diff --git a/content/content_browser.gypi b/content/content_browser.gypi index dffad26..c2710a0 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -748,16 +748,6 @@ 'browser/worker_host/worker_service_impl.h', 'browser/zygote_host_impl_linux.cc', 'browser/zygote_host_impl_linux.h', - # TODO: These should be moved to test_support (see below), but - # are currently used by production code in automation_provider.cc. - 'test/net/url_request_failed_job.cc', - 'test/net/url_request_failed_job.h', - 'test/net/url_request_mock_http_job.cc', - 'test/net/url_request_mock_http_job.h', - 'test/net/url_request_slow_download_job.cc', - 'test/net/url_request_slow_download_job.h', - 'test/net/url_request_slow_http_job.cc', - 'test/net/url_request_slow_http_job.h', 'zygote/zygote_linux.cc', 'zygote/zygote_linux.h', 'zygote/zygote_main_linux.cc', diff --git a/content/content_tests.gypi b/content/content_tests.gypi index 930dc3f..3845e9b 100644 --- a/content/content_tests.gypi +++ b/content/content_tests.gypi @@ -92,6 +92,14 @@ 'test/mock_render_process_host.cc', 'test/mock_render_thread.cc', 'test/mock_resource_context.cc', + 'test/net/url_request_failed_job.cc', + 'test/net/url_request_failed_job.h', + 'test/net/url_request_mock_http_job.cc', + 'test/net/url_request_mock_http_job.h', + 'test/net/url_request_slow_download_job.cc', + 'test/net/url_request_slow_download_job.h', + 'test/net/url_request_slow_http_job.cc', + 'test/net/url_request_slow_http_job.h', 'test/net/url_request_abort_on_end_job.cc', 'test/net/url_request_abort_on_end_job.h', 'test/render_view_fake_resources_test.cc', diff --git a/content/public/test/test_browser_context.h b/content/public/test/test_browser_context.h index c76eb08..3a73a69 100644 --- a/content/public/test/test_browser_context.h +++ b/content/public/test/test_browser_context.h @@ -54,6 +54,6 @@ class TestBrowserContext : public BrowserContext { DISALLOW_COPY_AND_ASSIGN(TestBrowserContext); }; -} +} // namespace content #endif // CONTENT_PUBLIC_TEST_TEST_BROWSER_CONTEXT_H_ diff --git a/content/test/net/url_request_failed_job.h b/content/test/net/url_request_failed_job.h index b09edb7..77ff6f0 100644 --- a/content/test/net/url_request_failed_job.h +++ b/content/test/net/url_request_failed_job.h @@ -10,7 +10,6 @@ #include "base/compiler_specific.h" #include "base/memory/weak_ptr.h" -#include "content/common/content_export.h" #include "googleurl/src/gurl.h" #include "net/url_request/url_request_job.h" @@ -23,13 +22,13 @@ class URLRequestFailedJob : public net::URLRequestJob { virtual void Start() OVERRIDE; // Adds the testing URLs to the net::URLRequestFilter. - CONTENT_EXPORT static void AddUrlHandler(); + static void AddUrlHandler(); // Given a net error code, constructs a mock URL that will return that error // asynchronously when started. |net_error| must be a valid net error code // other than net::OK and net::ERR_IO_PENDING. - CONTENT_EXPORT static GURL GetMockHttpUrl(int net_error); - CONTENT_EXPORT static GURL GetMockHttpsUrl(int net_error); + static GURL GetMockHttpUrl(int net_error); + static GURL GetMockHttpsUrl(int net_error); private: static net::URLRequestJob* Factory(net::URLRequest* request, diff --git a/content/test/net/url_request_mock_http_job.h b/content/test/net/url_request_mock_http_job.h index ba2c47a..21a84ee 100644 --- a/content/test/net/url_request_mock_http_job.h +++ b/content/test/net/url_request_mock_http_job.h @@ -10,12 +10,11 @@ #include <string> -#include "content/common/content_export.h" #include "net/url_request/url_request_file_job.h" class FilePath; -class CONTENT_EXPORT URLRequestMockHTTPJob : public net::URLRequestFileJob { +class URLRequestMockHTTPJob : public net::URLRequestFileJob { public: URLRequestMockHTTPJob(net::URLRequest* request, const FilePath& file_path); diff --git a/content/test/net/url_request_slow_download_job.h b/content/test/net/url_request_slow_download_job.h index 5ef40c4..698ced8 100644 --- a/content/test/net/url_request_slow_download_job.h +++ b/content/test/net/url_request_slow_download_job.h @@ -15,19 +15,18 @@ #include "base/lazy_instance.h" #include "base/memory/weak_ptr.h" -#include "content/common/content_export.h" #include "net/url_request/url_request_job.h" class URLRequestSlowDownloadJob : public net::URLRequestJob { public: // Test URLs. - CONTENT_EXPORT static const char kUnknownSizeUrl[]; - CONTENT_EXPORT static const char kKnownSizeUrl[]; - CONTENT_EXPORT static const char kFinishDownloadUrl[]; + static const char kUnknownSizeUrl[]; + static const char kKnownSizeUrl[]; + static const char kFinishDownloadUrl[]; // Download sizes. - CONTENT_EXPORT static const int kFirstDownloadSize; - CONTENT_EXPORT static const int kSecondDownloadSize; + static const int kFirstDownloadSize; + static const int kSecondDownloadSize; // Timer callback, used to check to see if we should finish our download and // send the second chunk. @@ -46,10 +45,10 @@ class URLRequestSlowDownloadJob : public net::URLRequestJob { // Returns the current number of URLRequestSlowDownloadJobs that have // not yet completed. - CONTENT_EXPORT static size_t NumberOutstandingRequests(); + static size_t NumberOutstandingRequests(); // Adds the testing URLs to the net::URLRequestFilter. - CONTENT_EXPORT static void AddUrlHandler(); + static void AddUrlHandler(); private: explicit URLRequestSlowDownloadJob(net::URLRequest* request); diff --git a/content/test/net/url_request_slow_http_job.h b/content/test/net/url_request_slow_http_job.h index 08e5df3..c6df6da 100644 --- a/content/test/net/url_request_slow_http_job.h +++ b/content/test/net/url_request_slow_http_job.h @@ -10,7 +10,6 @@ #include "base/timer.h" #include "content/test/net/url_request_mock_http_job.h" -#include "content/common/content_export.h" class URLRequestSlowHTTPJob : public URLRequestMockHTTPJob { public: @@ -21,7 +20,7 @@ class URLRequestSlowHTTPJob : public URLRequestMockHTTPJob { static net::URLRequest::ProtocolFactory Factory; // Adds the testing URLs to the net::URLRequestFilter. - CONTENT_EXPORT static void AddUrlHandler(const FilePath& base_path); + static void AddUrlHandler(const FilePath& base_path); // Given the path to a file relative to the path passed to AddUrlHandler(), // construct a mock URL. |