OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "net/base/cert_verifier.h" | 10 #include "net/base/cert_verifier.h" |
| 11 #include "net/base/host_port_pair.h" |
11 #include "net/base/mock_host_resolver.h" | 12 #include "net/base/mock_host_resolver.h" |
12 #include "net/base/request_priority.h" | 13 #include "net/base/request_priority.h" |
13 #include "net/base/ssl_config_service_defaults.h" | 14 #include "net/base/ssl_config_service_defaults.h" |
| 15 #include "net/base/sys_addrinfo.h" |
14 #include "net/http/http_auth_handler_factory.h" | 16 #include "net/http/http_auth_handler_factory.h" |
15 #include "net/http/http_cache.h" | 17 #include "net/http/http_cache.h" |
16 #include "net/http/http_network_session.h" | 18 #include "net/http/http_network_session.h" |
17 #include "net/http/http_network_layer.h" | 19 #include "net/http/http_network_layer.h" |
18 #include "net/http/http_transaction_factory.h" | 20 #include "net/http/http_transaction_factory.h" |
19 #include "net/proxy/proxy_service.h" | 21 #include "net/proxy/proxy_service.h" |
20 #include "net/socket/socket_test_util.h" | 22 #include "net/socket/socket_test_util.h" |
21 #include "net/spdy/spdy_framer.h" | 23 #include "net/spdy/spdy_framer.h" |
22 #include "net/url_request/url_request_context.h" | 24 #include "net/url_request/url_request_context.h" |
23 #include "net/url_request/url_request_context_storage.h" | 25 #include "net/url_request/url_request_context_storage.h" |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 365 |
364 protected: | 366 protected: |
365 virtual ~SpdyURLRequestContext(); | 367 virtual ~SpdyURLRequestContext(); |
366 | 368 |
367 private: | 369 private: |
368 MockClientSocketFactory socket_factory_; | 370 MockClientSocketFactory socket_factory_; |
369 net::URLRequestContextStorage storage_; | 371 net::URLRequestContextStorage storage_; |
370 }; | 372 }; |
371 | 373 |
372 const SpdyHeaderInfo make_spdy_header(spdy::SpdyControlType type); | 374 const SpdyHeaderInfo make_spdy_header(spdy::SpdyControlType type); |
| 375 |
| 376 class SpdySessionPoolPeer { |
| 377 public: |
| 378 explicit SpdySessionPoolPeer(SpdySessionPool* pool) |
| 379 : pool_(pool) {} |
| 380 |
| 381 void AddAlias(const addrinfo* address, const HostPortProxyPair& pair) { |
| 382 pool_->AddAlias(address, pair); |
| 383 } |
| 384 |
| 385 void RemoveSpdySession(const scoped_refptr<SpdySession>& session) { |
| 386 pool_->Remove(session); |
| 387 } |
| 388 |
| 389 private: |
| 390 SpdySessionPool* const pool_; |
| 391 |
| 392 DISALLOW_COPY_AND_ASSIGN(SpdySessionPoolPeer); |
| 393 }; |
| 394 |
373 } // namespace net | 395 } // namespace net |
374 | 396 |
375 #endif // NET_SPDY_SPDY_TEST_UTIL_H_ | 397 #endif // NET_SPDY_SPDY_TEST_UTIL_H_ |
OLD | NEW |