diff options
-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__ |