Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: net/url_request/url_request_test_util.cc

Issue 10918279: Provide mutable members of UrlRequestContext via pure-virtual interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address erikwright's second round of comments. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request_test_util.cc
diff --git a/net/url_request/url_request_test_util.cc b/net/url_request/url_request_test_util.cc
index 5388b4978a5c66cfae615dbfb3b34c7fe30a8f9e..34dc5cfc5f7bbaa69bfd0a71a9b52cc36011727e 100644
--- a/net/url_request/url_request_test_util.cc
+++ b/net/url_request/url_request_test_util.cc
@@ -16,6 +16,7 @@
#include "net/base/server_bound_cert_service.h"
#include "net/http/http_network_session.h"
#include "net/http/http_server_properties_impl.h"
+#include "net/url_request/const_http_user_agent_settings.h"
#include "net/url_request/url_request_job_factory_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -108,10 +109,16 @@ void TestURLRequestContext::Init() {
new net::DefaultServerBoundCertStore(NULL),
base::WorkerPool::GetTaskRunner(true)));
}
- if (accept_language().empty())
- set_accept_language("en-us,fr");
- if (accept_charset().empty())
- set_accept_charset("iso-8859-1,*,utf-8");
+ if (accept_language().empty()) {
+ context_storage_.set_http_user_agent_settings(
+ new net::ConstHttpUserAgentSettings(
+ "en-us,fr", accept_charset(), EmptyString()));
+ }
+ if (accept_charset().empty()) {
+ context_storage_.set_http_user_agent_settings(
+ new net::ConstHttpUserAgentSettings(
+ accept_language(), "iso-8859-1,*,utf-8", EmptyString()));
+ }
if (!job_factory())
context_storage_.set_job_factory(new net::URLRequestJobFactoryImpl);
}

Powered by Google App Engine
This is Rietveld 408576698