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

Unified Diff: net/url_request/url_request_test_util.cc

Issue 1893393003: Fix TestURLRequestContext's code to create a ChannelIDService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f45c283dec2679bd75f974f26b1ea8a2b0ed9aff..3f9ffb53fef1f3f9758b9cdef15cbfad1072443d 100644
--- a/net/url_request/url_request_test_util.cc
+++ b/net/url_request/url_request_test_util.cc
@@ -93,6 +93,18 @@ void TestURLRequestContext::Init() {
context_storage_.set_http_server_properties(
std::unique_ptr<HttpServerProperties>(new HttpServerPropertiesImpl()));
}
+ // In-memory cookie store.
+ if (!cookie_store()) {
+ context_storage_.set_cookie_store(
+ base::WrapUnique(new CookieMonster(nullptr, nullptr)));
+ }
+ // In-memory Channel ID service. Must be created before the
+ // HttpNetworkSession.
+ if (!channel_id_service()) {
+ context_storage_.set_channel_id_service(base::WrapUnique(
+ new ChannelIDService(new DefaultChannelIDStore(nullptr),
+ base::WorkerPool::GetTaskRunner(true))));
+ }
if (http_transaction_factory()) {
// Make sure we haven't been passed an object we're not going to use.
EXPECT_FALSE(client_socket_factory_);
@@ -121,17 +133,6 @@ void TestURLRequestContext::Init() {
new HttpCache(context_storage_.http_network_session(),
HttpCache::DefaultBackend::InMemory(0), false)));
}
- // In-memory cookie store.
- if (!cookie_store()) {
- context_storage_.set_cookie_store(
- base::WrapUnique(new CookieMonster(nullptr, nullptr)));
- }
- // In-memory Channel ID service.
- if (!channel_id_service()) {
- context_storage_.set_channel_id_service(base::WrapUnique(
- new ChannelIDService(new DefaultChannelIDStore(nullptr),
- base::WorkerPool::GetTaskRunner(true))));
- }
if (!http_user_agent_settings()) {
context_storage_.set_http_user_agent_settings(base::WrapUnique(
new StaticHttpUserAgentSettings("en-us,fr", std::string())));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698