Use the same fake User-Agent string as GetContentShell()->GetUserAgent() for URLReque...
commit145b29d3f634ec398e0e77add8daa601e8911f79
authortyoshino@chromium.org <tyoshino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Sat, 7 Jun 2014 09:46:19 +0000 (7 09:46 +0000)
committertyoshino@chromium.org <tyoshino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Sat, 7 Jun 2014 09:46:19 +0000 (7 09:46 +0000)
tree035c85a7a73452b12e741f13920307ba339de79f
parent6951f97d3193b1d30b7593c953b612beb98e927c
Use the same fake User-Agent string as GetContentShell()->GetUserAgent() for URLRequestContext in content_shell

ShellContentClient::GetUserAgent() returns a fake User-Agent. It's used
for navigator.userAgent, loading layout test test case file, etc. But
ShellURLRequestContextGetter has an HttpUserAgentSettings with an empty
string for User-Agent. Factor out the code to build the fake User-Agent
from ShellContentClient::GetUserAgent() into GetShellUserAgent() and use
it for ShellURLRequestContextGetter. This is almost the same as how
ChromeShellContentClient and ChromeURLRequestContextGetter are doing.

With this, we can test that WebSocket handshake request contains the
correct user-agent header value.

BUG=347109

Review URL: https://codereview.chromium.org/319083003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275673 0039d316-1c4b-4281-b951-d872f2087c98
content/shell/browser/shell_url_request_context_getter.cc
content/shell/common/shell_content_client.cc
content/shell/common/shell_content_client.h