| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef NET_SPDY_SPDY_TEST_UTIL_H_ | 5 #ifndef NET_SPDY_SPDY_TEST_UTIL_H_ |
| 6 #define NET_SPDY_SPDY_TEST_UTIL_H_ | 6 #define NET_SPDY_SPDY_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "net/base/cert_verifier.h" | 9 #include "net/base/cert_verifier.h" |
| 10 #include "net/base/host_port_pair.h" | 10 #include "net/base/host_port_pair.h" |
| 11 #include "net/base/mock_host_resolver.h" | 11 #include "net/base/mock_host_resolver.h" |
| 12 #include "net/base/request_priority.h" | 12 #include "net/base/request_priority.h" |
| 13 #include "net/base/ssl_config_service_defaults.h" | 13 #include "net/base/ssl_config_service_defaults.h" |
| 14 #include "net/http/http_auth_handler_factory.h" | 14 #include "net/http/http_auth_handler_factory.h" |
| 15 #include "net/http/http_cache.h" | 15 #include "net/http/http_cache.h" |
| 16 #include "net/http/http_network_session.h" | 16 #include "net/http/http_network_session.h" |
| 17 #include "net/http/http_network_layer.h" | 17 #include "net/http/http_network_layer.h" |
| 18 #include "net/http/http_server_properties_impl.h" | 18 #include "net/http/http_server_properties_impl.h" |
| 19 #include "net/http/http_transaction_factory.h" | 19 #include "net/http/http_transaction_factory.h" |
| 20 #include "net/proxy/proxy_service.h" | 20 #include "net/proxy/proxy_service.h" |
| 21 #include "net/socket/socket_test_util.h" | 21 #include "net/socket/socket_test_util.h" |
| 22 #include "net/spdy/spdy_session.h" |
| 22 #include "net/url_request/url_request_context.h" | 23 #include "net/url_request/url_request_context.h" |
| 23 #include "net/url_request/url_request_context_storage.h" | 24 #include "net/url_request/url_request_context_storage.h" |
| 24 | 25 |
| 25 namespace net { | 26 namespace net { |
| 26 | 27 |
| 27 namespace test_spdy2 { | 28 namespace test_spdy2 { |
| 28 | 29 |
| 29 // Default upload data used by both, mock objects and framer when creating | 30 // Default upload data used by both, mock objects and framer when creating |
| 30 // data frames. | 31 // data frames. |
| 31 const char kDefaultURL[] = "http://www.google.com"; | 32 const char kDefaultURL[] = "http://www.google.com"; |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 | 358 |
| 358 // NOTE: host_resolver must be ordered before http_auth_handler_factory. | 359 // NOTE: host_resolver must be ordered before http_auth_handler_factory. |
| 359 scoped_ptr<MockHostResolverBase> host_resolver; | 360 scoped_ptr<MockHostResolverBase> host_resolver; |
| 360 scoped_ptr<CertVerifier> cert_verifier; | 361 scoped_ptr<CertVerifier> cert_verifier; |
| 361 scoped_ptr<ProxyService> proxy_service; | 362 scoped_ptr<ProxyService> proxy_service; |
| 362 scoped_refptr<SSLConfigService> ssl_config_service; | 363 scoped_refptr<SSLConfigService> ssl_config_service; |
| 363 scoped_ptr<MockClientSocketFactory> socket_factory; | 364 scoped_ptr<MockClientSocketFactory> socket_factory; |
| 364 scoped_ptr<DeterministicMockClientSocketFactory> deterministic_socket_factory; | 365 scoped_ptr<DeterministicMockClientSocketFactory> deterministic_socket_factory; |
| 365 scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory; | 366 scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory; |
| 366 HttpServerPropertiesImpl http_server_properties; | 367 HttpServerPropertiesImpl http_server_properties; |
| 368 bool enable_ip_pooling; |
| 369 bool enable_compression; |
| 370 bool enable_ping; |
| 371 SpdySession::TimeFunc time_func; |
| 367 std::string trusted_spdy_proxy; | 372 std::string trusted_spdy_proxy; |
| 368 NetLog* net_log; | 373 NetLog* net_log; |
| 369 }; | 374 }; |
| 370 | 375 |
| 371 class SpdyURLRequestContext : public URLRequestContext { | 376 class SpdyURLRequestContext : public URLRequestContext { |
| 372 public: | 377 public: |
| 373 SpdyURLRequestContext(); | 378 SpdyURLRequestContext(); |
| 374 virtual ~SpdyURLRequestContext(); | 379 virtual ~SpdyURLRequestContext(); |
| 375 | 380 |
| 376 MockClientSocketFactory& socket_factory() { return socket_factory_; } | 381 MockClientSocketFactory& socket_factory() { return socket_factory_; } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 406 void EnableSendingInitialSettings(bool enabled) { | 411 void EnableSendingInitialSettings(bool enabled) { |
| 407 pool_->enable_sending_initial_settings_ = enabled; | 412 pool_->enable_sending_initial_settings_ = enabled; |
| 408 } | 413 } |
| 409 | 414 |
| 410 private: | 415 private: |
| 411 SpdySessionPool* const pool_; | 416 SpdySessionPool* const pool_; |
| 412 | 417 |
| 413 DISALLOW_COPY_AND_ASSIGN(SpdySessionPoolPeer); | 418 DISALLOW_COPY_AND_ASSIGN(SpdySessionPoolPeer); |
| 414 }; | 419 }; |
| 415 | 420 |
| 416 // Helper to manage the state of a number of SPDY global variables. | |
| 417 class SpdyTestStateHelper { | |
| 418 public: | |
| 419 SpdyTestStateHelper(); | |
| 420 ~SpdyTestStateHelper(); | |
| 421 | |
| 422 private: | |
| 423 DISALLOW_COPY_AND_ASSIGN(SpdyTestStateHelper); | |
| 424 }; | |
| 425 | |
| 426 } // namespace test_spdy2 | 421 } // namespace test_spdy2 |
| 427 | 422 |
| 428 } // namespace net | 423 } // namespace net |
| 429 | 424 |
| 430 #endif // NET_SPDY_SPDY_TEST_UTIL_H_ | 425 #endif // NET_SPDY_SPDY_TEST_UTIL_H_ |
| OLD | NEW |