OLD | NEW |
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" |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 ssl_config_service(new SSLConfigServiceDefaults), | 360 ssl_config_service(new SSLConfigServiceDefaults), |
361 socket_factory(new MockClientSocketFactory), | 361 socket_factory(new MockClientSocketFactory), |
362 deterministic_socket_factory(new DeterministicMockClientSocketFactory), | 362 deterministic_socket_factory(new DeterministicMockClientSocketFactory), |
363 http_auth_handler_factory( | 363 http_auth_handler_factory( |
364 HttpAuthHandlerFactory::CreateDefault(host_resolver.get())), | 364 HttpAuthHandlerFactory::CreateDefault(host_resolver.get())), |
365 enable_ip_pooling(true), | 365 enable_ip_pooling(true), |
366 enable_compression(false), | 366 enable_compression(false), |
367 enable_ping(false), | 367 enable_ping(false), |
368 enable_user_alternate_protocol_ports(false), | 368 enable_user_alternate_protocol_ports(false), |
369 protocol(protocol), | 369 protocol(protocol), |
370 stream_initial_recv_window_size(kSpdyStreamInitialWindowSize), | 370 stream_initial_recv_window_size( |
| 371 SpdySession::GetInitialWindowSize(protocol)), |
371 time_func(&base::TimeTicks::Now), | 372 time_func(&base::TimeTicks::Now), |
372 force_spdy_over_ssl(false), | 373 force_spdy_over_ssl(false), |
373 force_spdy_always(false), | 374 force_spdy_always(false), |
374 use_alternate_protocols(false), | 375 use_alternate_protocols(false), |
375 net_log(NULL) { | 376 net_log(NULL) { |
376 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; | 377 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; |
377 | 378 |
378 // Note: The CancelledTransaction test does cleanup by running all | 379 // Note: The CancelledTransaction test does cleanup by running all |
379 // tasks in the message loop (RunAllPending). Unfortunately, that | 380 // tasks in the message loop (RunAllPending). Unfortunately, that |
380 // doesn't clean up tasks on the host resolver thread; and | 381 // doesn't clean up tasks on the host resolver thread; and |
381 // TCPConnectJob is currently not cancellable. Using synchronous | 382 // TCPConnectJob is currently not cancellable. Using synchronous |
382 // lookups allows the test to shutdown cleanly. Until we have | 383 // lookups allows the test to shutdown cleanly. Until we have |
383 // cancellable TCPConnectJobs, use synchronous lookups. | 384 // cancellable TCPConnectJobs, use synchronous lookups. |
384 host_resolver->set_synchronous_mode(true); | 385 host_resolver->set_synchronous_mode(true); |
385 } | 386 } |
386 | 387 |
387 SpdySessionDependencies::SpdySessionDependencies( | 388 SpdySessionDependencies::SpdySessionDependencies(NextProto protocol, |
388 NextProto protocol, ProxyService* proxy_service) | 389 ProxyService* proxy_service) |
389 : host_resolver(new MockHostResolver), | 390 : host_resolver(new MockHostResolver), |
390 cert_verifier(new MockCertVerifier), | 391 cert_verifier(new MockCertVerifier), |
391 transport_security_state(new TransportSecurityState), | 392 transport_security_state(new TransportSecurityState), |
392 proxy_service(proxy_service), | 393 proxy_service(proxy_service), |
393 ssl_config_service(new SSLConfigServiceDefaults), | 394 ssl_config_service(new SSLConfigServiceDefaults), |
394 socket_factory(new MockClientSocketFactory), | 395 socket_factory(new MockClientSocketFactory), |
395 deterministic_socket_factory(new DeterministicMockClientSocketFactory), | 396 deterministic_socket_factory(new DeterministicMockClientSocketFactory), |
396 http_auth_handler_factory( | 397 http_auth_handler_factory( |
397 HttpAuthHandlerFactory::CreateDefault(host_resolver.get())), | 398 HttpAuthHandlerFactory::CreateDefault(host_resolver.get())), |
398 enable_ip_pooling(true), | 399 enable_ip_pooling(true), |
399 enable_compression(false), | 400 enable_compression(false), |
400 enable_ping(false), | 401 enable_ping(false), |
401 enable_user_alternate_protocol_ports(false), | 402 enable_user_alternate_protocol_ports(false), |
402 protocol(protocol), | 403 protocol(protocol), |
403 stream_initial_recv_window_size(kSpdyStreamInitialWindowSize), | 404 stream_initial_recv_window_size( |
| 405 SpdySession::GetInitialWindowSize(protocol)), |
404 time_func(&base::TimeTicks::Now), | 406 time_func(&base::TimeTicks::Now), |
405 force_spdy_over_ssl(false), | 407 force_spdy_over_ssl(false), |
406 force_spdy_always(false), | 408 force_spdy_always(false), |
407 use_alternate_protocols(false), | 409 use_alternate_protocols(false), |
408 net_log(NULL) { | 410 net_log(NULL) { |
409 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; | 411 DCHECK(next_proto_is_spdy(protocol)) << "Invalid protocol: " << protocol; |
410 } | 412 } |
411 | 413 |
412 SpdySessionDependencies::~SpdySessionDependencies() {} | 414 SpdySessionDependencies::~SpdySessionDependencies() {} |
413 | 415 |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1310 } | 1312 } |
1311 } | 1313 } |
1312 | 1314 |
1313 void SpdyTestUtil::SetPriority(RequestPriority priority, | 1315 void SpdyTestUtil::SetPriority(RequestPriority priority, |
1314 SpdySynStreamIR* ir) const { | 1316 SpdySynStreamIR* ir) const { |
1315 ir->set_priority(ConvertRequestPriorityToSpdyPriority( | 1317 ir->set_priority(ConvertRequestPriorityToSpdyPriority( |
1316 priority, spdy_version())); | 1318 priority, spdy_version())); |
1317 } | 1319 } |
1318 | 1320 |
1319 } // namespace net | 1321 } // namespace net |
OLD | NEW |