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 #ifndef NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 5 #ifndef NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
6 #define NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 6 #define NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 // Creates a SPDY session for the given key and puts it in the SPDY | 240 // Creates a SPDY session for the given key and puts it in the SPDY |
241 // session pool in |http_session|. A SPDY session for |key| must not | 241 // session pool in |http_session|. A SPDY session for |key| must not |
242 // already exist. | 242 // already exist. |
243 base::WeakPtr<SpdySession> CreateInsecureSpdySession( | 243 base::WeakPtr<SpdySession> CreateInsecureSpdySession( |
244 const scoped_refptr<HttpNetworkSession>& http_session, | 244 const scoped_refptr<HttpNetworkSession>& http_session, |
245 const SpdySessionKey& key, | 245 const SpdySessionKey& key, |
246 const BoundNetLog& net_log); | 246 const BoundNetLog& net_log); |
247 | 247 |
248 // Tries to create a SPDY session for the given key but expects the | 248 // Tries to create a SPDY session for the given key but expects the |
249 // attempt to fail with the given error. A SPDY session for |key| must | 249 // attempt to fail with the given error. A SPDY session for |key| must |
250 // not already exist. The session will be created but close in the | 250 // not already exist. |
251 // next event loop iteration. | 251 void TryCreateInsecureSpdySessionExpectingFailure( |
252 base::WeakPtr<SpdySession> TryCreateInsecureSpdySessionExpectingFailure( | |
253 const scoped_refptr<HttpNetworkSession>& http_session, | 252 const scoped_refptr<HttpNetworkSession>& http_session, |
254 const SpdySessionKey& key, | 253 const SpdySessionKey& key, |
255 Error expected_error, | 254 Error expected_error, |
256 const BoundNetLog& net_log); | 255 const BoundNetLog& net_log); |
257 | 256 |
258 // Like CreateInsecureSpdySession(), but uses TLS. | 257 // Like CreateInsecureSpdySession(), but uses TLS. |
259 base::WeakPtr<SpdySession> CreateSecureSpdySession( | 258 base::WeakPtr<SpdySession> CreateSecureSpdySession( |
260 const scoped_refptr<HttpNetworkSession>& http_session, | 259 const scoped_refptr<HttpNetworkSession>& http_session, |
261 const SpdySessionKey& key, | 260 const SpdySessionKey& key, |
262 const BoundNetLog& net_log); | 261 const BoundNetLog& net_log); |
263 | 262 |
264 // Creates an insecure SPDY session for the given key and puts it in | 263 // Creates an insecure SPDY session for the given key and puts it in |
265 // |pool|. The returned session will neither receive nor send any | 264 // |pool|. The returned session will neither receive nor send any |
266 // data. A SPDY session for |key| must not already exist. | 265 // data. A SPDY session for |key| must not already exist. |
267 base::WeakPtr<SpdySession> CreateFakeSpdySession(SpdySessionPool* pool, | 266 base::WeakPtr<SpdySession> CreateFakeSpdySession(SpdySessionPool* pool, |
268 const SpdySessionKey& key); | 267 const SpdySessionKey& key); |
269 | 268 |
270 // Tries to create an insecure SPDY session for the given key but | 269 // Tries to create an insecure SPDY session for the given key but |
271 // expects the attempt to fail with the given error. The session will | 270 // expects the attempt to fail with the given error. The session will |
272 // neither receive nor send any data. A SPDY session for |key| must | 271 // neither receive nor send any data. A SPDY session for |key| must |
273 // not already exist. The session will be created but close in the | 272 // not already exist. |
274 // next event loop iteration. | 273 void TryCreateFakeSpdySessionExpectingFailure(SpdySessionPool* pool, |
275 base::WeakPtr<SpdySession> TryCreateFakeSpdySessionExpectingFailure( | 274 const SpdySessionKey& key, |
276 SpdySessionPool* pool, | 275 Error expected_error); |
277 const SpdySessionKey& key, | |
278 Error expected_error); | |
279 | 276 |
280 class SpdySessionPoolPeer { | 277 class SpdySessionPoolPeer { |
281 public: | 278 public: |
282 explicit SpdySessionPoolPeer(SpdySessionPool* pool); | 279 explicit SpdySessionPoolPeer(SpdySessionPool* pool); |
283 | 280 |
284 void RemoveAliases(const SpdySessionKey& key); | 281 void RemoveAliases(const SpdySessionKey& key); |
285 void DisableDomainAuthenticationVerification(); | 282 void DisableDomainAuthenticationVerification(); |
286 void SetEnableSendingInitialData(bool enabled); | 283 void SetEnableSendingInitialData(bool enabled); |
287 | 284 |
288 private: | 285 private: |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 base::StringPiece url, | 525 base::StringPiece url, |
529 int64* content_length) const; | 526 int64* content_length) const; |
530 | 527 |
531 const NextProto protocol_; | 528 const NextProto protocol_; |
532 const SpdyMajorVersion spdy_version_; | 529 const SpdyMajorVersion spdy_version_; |
533 }; | 530 }; |
534 | 531 |
535 } // namespace net | 532 } // namespace net |
536 | 533 |
537 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ | 534 #endif // NET_SPDY_SPDY_TEST_UTIL_COMMON_H_ |
OLD | NEW |