diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-21 01:05:24 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-21 01:05:24 +0000 |
commit | 876d21bcde61953d9e304a5bc107c800c597500f (patch) | |
tree | a2b502920f1e8cba91b76d75e259751f67172811 | |
parent | 0811bfd2b0f65cc84b5914282823600451a09177 (diff) | |
download | chromium_src-876d21bcde61953d9e304a5bc107c800c597500f.zip chromium_src-876d21bcde61953d9e304a5bc107c800c597500f.tar.gz chromium_src-876d21bcde61953d9e304a5bc107c800c597500f.tar.bz2 |
Ensure that we always use a direct connection to the internet when running in
layout test mode. This should help avoid some spurious errors caused by proxy
servers.
R=tony
Review URL: http://codereview.chromium.org/11334
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5807 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/tools/test_shell/test_shell_main.cc | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_request_context.cc | 18 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_request_context.h | 6 |
3 files changed, 17 insertions, 9 deletions
diff --git a/webkit/tools/test_shell/test_shell_main.cc b/webkit/tools/test_shell/test_shell_main.cc index a24ea7d..91a9567 100644 --- a/webkit/tools/test_shell/test_shell_main.cc +++ b/webkit/tools/test_shell/test_shell_main.cc @@ -155,7 +155,7 @@ int main(int argc, char* argv[]) { // Initializing with a default context, which means no on-disk cookie DB, // and no support for directory listings. SimpleResourceLoaderBridge::Init( - new TestShellRequestContext(cache_path, cache_mode)); + new TestShellRequestContext(cache_path, cache_mode, layout_test_mode)); // Load ICU data tables icu_util::Initialize(); diff --git a/webkit/tools/test_shell/test_shell_request_context.cc b/webkit/tools/test_shell/test_shell_request_context.cc index 9767b83..0304e20 100644 --- a/webkit/tools/test_shell/test_shell_request_context.cc +++ b/webkit/tools/test_shell/test_shell_request_context.cc @@ -5,21 +5,24 @@ #include "webkit/tools/test_shell/test_shell_request_context.h" #include "net/base/cookie_monster.h" +#include "net/proxy/proxy_service.h" #include "webkit/glue/webkit_glue.h" TestShellRequestContext::TestShellRequestContext() { - Init(std::wstring(), net::HttpCache::NORMAL); + Init(std::wstring(), net::HttpCache::NORMAL, false); } TestShellRequestContext::TestShellRequestContext( const std::wstring& cache_path, - net::HttpCache::Mode cache_mode) { - Init(cache_path, cache_mode); + net::HttpCache::Mode cache_mode, + bool no_proxy) { + Init(cache_path, cache_mode, no_proxy); } void TestShellRequestContext::Init( const std::wstring& cache_path, - net::HttpCache::Mode cache_mode) { + net::HttpCache::Mode cache_mode, + bool no_proxy) { cookie_store_ = new net::CookieMonster(); user_agent_ = webkit_glue::GetUserAgent(); @@ -28,11 +31,14 @@ void TestShellRequestContext::Init( accept_language_ = "en-us,en"; accept_charset_ = "iso-8859-1,*,utf-8"; + net::ProxyInfo proxy_info; + proxy_info.UseDirect(); + net::HttpCache *cache; if (cache_path.empty()) { - cache = new net::HttpCache(NULL, 0); + cache = new net::HttpCache(no_proxy ? &proxy_info : NULL, 0); } else { - cache = new net::HttpCache(NULL, cache_path, 0); + cache = new net::HttpCache(no_proxy ? &proxy_info : NULL, cache_path, 0); } cache->set_mode(cache_mode); http_transaction_factory_ = cache; diff --git a/webkit/tools/test_shell/test_shell_request_context.h b/webkit/tools/test_shell/test_shell_request_context.h index c4798ced..45a899d 100644 --- a/webkit/tools/test_shell/test_shell_request_context.h +++ b/webkit/tools/test_shell/test_shell_request_context.h @@ -17,12 +17,14 @@ class TestShellRequestContext : public URLRequestContext { // Use an on-disk cache at the specified location. Optionally, use the cache // in playback or record mode. TestShellRequestContext(const std::wstring& cache_path, - net::HttpCache::Mode cache_mode); + net::HttpCache::Mode cache_mode, + bool no_proxy); ~TestShellRequestContext(); private: - void Init(const std::wstring& cache_path, net::HttpCache::Mode cache_mode); + void Init(const std::wstring& cache_path, net::HttpCache::Mode cache_mode, + bool no_proxy); }; #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_SHELL_REQUEST_CONTEXT_H__ |