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

Side by Side Diff: net/spdy/spdy_test_util_common.cc

Issue 311393002: Add URLRequestJobFactories to URLRequestContexts without one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add two more that aren't tested Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/spdy_test_util_common.h" 5 #include "net/spdy/spdy_test_util_common.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/string_split.h" 12 #include "base/strings/string_split.h"
13 #include "net/cert/mock_cert_verifier.h" 13 #include "net/cert/mock_cert_verifier.h"
14 #include "net/http/http_cache.h" 14 #include "net/http/http_cache.h"
15 #include "net/http/http_network_session.h" 15 #include "net/http/http_network_session.h"
16 #include "net/http/http_network_transaction.h" 16 #include "net/http/http_network_transaction.h"
17 #include "net/http/http_server_properties_impl.h" 17 #include "net/http/http_server_properties_impl.h"
18 #include "net/socket/socket_test_util.h" 18 #include "net/socket/socket_test_util.h"
19 #include "net/socket/ssl_client_socket.h" 19 #include "net/socket/ssl_client_socket.h"
20 #include "net/socket/transport_client_socket_pool.h" 20 #include "net/socket/transport_client_socket_pool.h"
21 #include "net/spdy/buffered_spdy_framer.h" 21 #include "net/spdy/buffered_spdy_framer.h"
22 #include "net/spdy/spdy_framer.h" 22 #include "net/spdy/spdy_framer.h"
23 #include "net/spdy/spdy_http_utils.h" 23 #include "net/spdy/spdy_http_utils.h"
24 #include "net/spdy/spdy_session.h" 24 #include "net/spdy/spdy_session.h"
25 #include "net/spdy/spdy_session_pool.h" 25 #include "net/spdy/spdy_session_pool.h"
26 #include "net/spdy/spdy_stream.h" 26 #include "net/spdy/spdy_stream.h"
27 #include "net/url_request/url_request_job_factory_impl.h"
27 28
28 namespace net { 29 namespace net {
29 30
30 namespace { 31 namespace {
31 32
32 bool next_proto_is_spdy(NextProto next_proto) { 33 bool next_proto_is_spdy(NextProto next_proto) {
33 return next_proto >= kProtoSPDYMinimumVersion && 34 return next_proto >= kProtoSPDYMinimumVersion &&
34 next_proto <= kProtoSPDYMaximumVersion; 35 next_proto <= kProtoSPDYMaximumVersion;
35 } 36 }
36 37
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 469
469 storage_.set_host_resolver(scoped_ptr<HostResolver>(new MockHostResolver)); 470 storage_.set_host_resolver(scoped_ptr<HostResolver>(new MockHostResolver));
470 storage_.set_cert_verifier(new MockCertVerifier); 471 storage_.set_cert_verifier(new MockCertVerifier);
471 storage_.set_transport_security_state(new TransportSecurityState); 472 storage_.set_transport_security_state(new TransportSecurityState);
472 storage_.set_proxy_service(ProxyService::CreateDirect()); 473 storage_.set_proxy_service(ProxyService::CreateDirect());
473 storage_.set_ssl_config_service(new SSLConfigServiceDefaults); 474 storage_.set_ssl_config_service(new SSLConfigServiceDefaults);
474 storage_.set_http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault( 475 storage_.set_http_auth_handler_factory(HttpAuthHandlerFactory::CreateDefault(
475 host_resolver())); 476 host_resolver()));
476 storage_.set_http_server_properties( 477 storage_.set_http_server_properties(
477 scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl())); 478 scoped_ptr<HttpServerProperties>(new HttpServerPropertiesImpl()));
479 storage_.set_job_factory(new URLRequestJobFactoryImpl());
478 net::HttpNetworkSession::Params params; 480 net::HttpNetworkSession::Params params;
479 params.client_socket_factory = &socket_factory_; 481 params.client_socket_factory = &socket_factory_;
480 params.host_resolver = host_resolver(); 482 params.host_resolver = host_resolver();
481 params.cert_verifier = cert_verifier(); 483 params.cert_verifier = cert_verifier();
482 params.transport_security_state = transport_security_state(); 484 params.transport_security_state = transport_security_state();
483 params.proxy_service = proxy_service(); 485 params.proxy_service = proxy_service();
484 params.ssl_config_service = ssl_config_service(); 486 params.ssl_config_service = ssl_config_service();
485 params.http_auth_handler_factory = http_auth_handler_factory(); 487 params.http_auth_handler_factory = http_auth_handler_factory();
486 params.network_delegate = network_delegate(); 488 params.network_delegate = network_delegate();
487 params.enable_spdy_compression = false; 489 params.enable_spdy_compression = false;
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 } 1240 }
1239 } 1241 }
1240 1242
1241 void SpdyTestUtil::SetPriority(RequestPriority priority, 1243 void SpdyTestUtil::SetPriority(RequestPriority priority,
1242 SpdySynStreamIR* ir) const { 1244 SpdySynStreamIR* ir) const {
1243 ir->set_priority(ConvertRequestPriorityToSpdyPriority( 1245 ir->set_priority(ConvertRequestPriorityToSpdyPriority(
1244 priority, spdy_version())); 1246 priority, spdy_version()));
1245 } 1247 }
1246 1248
1247 } // namespace net 1249 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698