| 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 // Common utilities for Quic tests | 5 // Common utilities for Quic tests |
| 6 | 6 |
| 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| 9 | 9 |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 private: | 502 private: |
| 503 scoped_ptr<QuicCryptoStream> crypto_stream_; | 503 scoped_ptr<QuicCryptoStream> crypto_stream_; |
| 504 | 504 |
| 505 DISALLOW_COPY_AND_ASSIGN(MockQuicSpdySession); | 505 DISALLOW_COPY_AND_ASSIGN(MockQuicSpdySession); |
| 506 }; | 506 }; |
| 507 | 507 |
| 508 class TestQuicSpdyServerSession : public QuicServerSessionBase { | 508 class TestQuicSpdyServerSession : public QuicServerSessionBase { |
| 509 public: | 509 public: |
| 510 TestQuicSpdyServerSession(QuicConnection* connection, | 510 TestQuicSpdyServerSession(QuicConnection* connection, |
| 511 const QuicConfig& config, | 511 const QuicConfig& config, |
| 512 const QuicCryptoServerConfig* crypto_config); | 512 const QuicCryptoServerConfig* crypto_config, |
| 513 QuicCompressedCertsCache* compressed_certs_cache); |
| 513 ~TestQuicSpdyServerSession() override; | 514 ~TestQuicSpdyServerSession() override; |
| 514 | 515 |
| 515 MOCK_METHOD1(CreateIncomingDynamicStream, QuicSpdyStream*(QuicStreamId id)); | 516 MOCK_METHOD1(CreateIncomingDynamicStream, QuicSpdyStream*(QuicStreamId id)); |
| 516 MOCK_METHOD1(CreateOutgoingDynamicStream, | 517 MOCK_METHOD1(CreateOutgoingDynamicStream, |
| 517 QuicSpdyStream*(SpdyPriority priority)); | 518 QuicSpdyStream*(SpdyPriority priority)); |
| 518 QuicCryptoServerStreamBase* CreateQuicCryptoServerStream( | 519 QuicCryptoServerStreamBase* CreateQuicCryptoServerStream( |
| 519 const QuicCryptoServerConfig* crypto_config) override; | 520 const QuicCryptoServerConfig* crypto_config) override; |
| 520 | 521 |
| 521 QuicCryptoServerStream* GetCryptoStream() override; | 522 QuicCryptoServerStream* GetCryptoStream() override; |
| 522 | 523 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 // connection_start_time should be synchronized witht the client | 792 // connection_start_time should be synchronized witht the client |
| 792 // start time, otherwise nonce verification will fail. | 793 // start time, otherwise nonce verification will fail. |
| 793 // supported_versions: Set of QUIC versions this server supports. | 794 // supported_versions: Set of QUIC versions this server supports. |
| 794 // helper: Pointer to the MockConnectionHelper to use for the session. | 795 // helper: Pointer to the MockConnectionHelper to use for the session. |
| 795 // crypto_server_config: Pointer to the crypto server config. | 796 // crypto_server_config: Pointer to the crypto server config. |
| 796 // server_connection: Pointer reference for newly created | 797 // server_connection: Pointer reference for newly created |
| 797 // connection. This object will be owned by the | 798 // connection. This object will be owned by the |
| 798 // server_session. | 799 // server_session. |
| 799 // server_session: Pointer reference for the newly created server | 800 // server_session: Pointer reference for the newly created server |
| 800 // session. The new object will be owned by the caller. | 801 // session. The new object will be owned by the caller. |
| 801 void CreateServerSessionForTest(QuicServerId server_id, | 802 void CreateServerSessionForTest( |
| 802 QuicTime::Delta connection_start_time, | 803 QuicServerId server_id, |
| 803 QuicVersionVector supported_versions, | 804 QuicTime::Delta connection_start_time, |
| 804 MockConnectionHelper* helper, | 805 QuicVersionVector supported_versions, |
| 805 QuicCryptoServerConfig* crypto_server_config, | 806 MockConnectionHelper* helper, |
| 806 PacketSavingConnection** server_connection, | 807 QuicCryptoServerConfig* crypto_server_config, |
| 807 TestQuicSpdyServerSession** server_session); | 808 QuicCompressedCertsCache* compressed_certs_cache, |
| 809 PacketSavingConnection** server_connection, |
| 810 TestQuicSpdyServerSession** server_session); |
| 808 | 811 |
| 809 // Helper to generate client side stream ids, generalizes | 812 // Helper to generate client side stream ids, generalizes |
| 810 // kClientDataStreamId1 etc. above. | 813 // kClientDataStreamId1 etc. above. |
| 811 QuicStreamId QuicClientDataStreamId(int i); | 814 QuicStreamId QuicClientDataStreamId(int i); |
| 812 | 815 |
| 813 } // namespace test | 816 } // namespace test |
| 814 } // namespace net | 817 } // namespace net |
| 815 | 818 |
| 816 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 819 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |