| Index: webkit/tools/test_shell/test_shell_request_context.cc
|
| diff --git a/webkit/tools/test_shell/test_shell_request_context.cc b/webkit/tools/test_shell/test_shell_request_context.cc
|
| index 80ce41074c7af77fd26b83636c38a36a1bcf40eb..1eba3282ee4845fb7a5a36f2ba345b250ff84aa7 100644
|
| --- a/webkit/tools/test_shell/test_shell_request_context.cc
|
| +++ b/webkit/tools/test_shell/test_shell_request_context.cc
|
| @@ -34,6 +34,22 @@
|
| #include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
|
| #include "webkit/user_agent/user_agent.h"
|
|
|
| +class TestShellHttpUserAgentSettings
|
| + : public net::ConstHttpAcceptLanguageAndCharset {
|
| + public:
|
| + TestShellHttpUserAgentSettings()
|
| + // hard-code A-L and A-C for test shells
|
| + : ConstHttpAcceptLanguageAndCharset("en-us,en", "iso-8859-1,*,utf-8") {}
|
| + virtual ~TestShellHttpUserAgentSettings() {}
|
| +
|
| + virtual const std::string& GetUserAgent(const GURL& url) OVERRIDE {
|
| + return webkit_glue::GetUserAgent(url);
|
| + }
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(TestShellHttpUserAgentSettings);
|
| +};
|
| +
|
| TestShellRequestContext::TestShellRequestContext()
|
| : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) {
|
| Init(FilePath(), net::HttpCache::NORMAL, false);
|
| @@ -56,9 +72,7 @@ void TestShellRequestContext::Init(
|
| new net::DefaultServerBoundCertStore(NULL),
|
| base::WorkerPool::GetTaskRunner(true)));
|
|
|
| - // hard-code A-L and A-C for test shells
|
| - set_accept_language("en-us,en");
|
| - set_accept_charset("iso-8859-1,*,utf-8");
|
| + storage_.set_http_user_agent_settings(new TestShellHttpUserAgentSettings);
|
|
|
| #if defined(OS_POSIX) && !defined(OS_MACOSX)
|
| // Use no proxy to avoid ProxyConfigServiceLinux.
|
| @@ -134,8 +148,3 @@ void TestShellRequestContext::Init(
|
|
|
| TestShellRequestContext::~TestShellRequestContext() {
|
| }
|
| -
|
| -const std::string& TestShellRequestContext::GetUserAgent(
|
| - const GURL& url) const {
|
| - return webkit_glue::GetUserAgent(url);
|
| -}
|
|
|