| 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 <string> | 10 #include <string> |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 bool fin, | 447 bool fin, |
| 448 size_t frame_len)); | 448 size_t frame_len)); |
| 449 MOCK_METHOD3(SendRstStream, void(QuicStreamId stream_id, | 449 MOCK_METHOD3(SendRstStream, void(QuicStreamId stream_id, |
| 450 QuicRstStreamErrorCode error, | 450 QuicRstStreamErrorCode error, |
| 451 QuicStreamOffset bytes_written)); | 451 QuicStreamOffset bytes_written)); |
| 452 MOCK_METHOD0(IsCryptoHandshakeConfirmed, bool()); | 452 MOCK_METHOD0(IsCryptoHandshakeConfirmed, bool()); |
| 453 MOCK_METHOD1(OnHeadersHeadOfLineBlocking, void(QuicTime::Delta delta)); | 453 MOCK_METHOD1(OnHeadersHeadOfLineBlocking, void(QuicTime::Delta delta)); |
| 454 | 454 |
| 455 using QuicSession::ActivateStream; | 455 using QuicSession::ActivateStream; |
| 456 | 456 |
| 457 // Returns a QuicConsumedData that indicates all of |data| (and |fin| if set) |
| 458 // has been consumed. |
| 459 static QuicConsumedData ConsumeAllData( |
| 460 QuicStreamId id, |
| 461 const QuicIOVector& data, |
| 462 QuicStreamOffset offset, |
| 463 bool fin, |
| 464 FecProtection fec_protection, |
| 465 QuicAckListenerInterface* ack_notifier_delegate); |
| 466 |
| 457 private: | 467 private: |
| 458 scoped_ptr<QuicCryptoStream> crypto_stream_; | 468 scoped_ptr<QuicCryptoStream> crypto_stream_; |
| 459 | 469 |
| 460 DISALLOW_COPY_AND_ASSIGN(MockQuicSpdySession); | 470 DISALLOW_COPY_AND_ASSIGN(MockQuicSpdySession); |
| 461 }; | 471 }; |
| 462 | 472 |
| 463 class TestQuicSpdyServerSession : public tools::QuicServerSession { | 473 class TestQuicSpdyServerSession : public tools::QuicServerSession { |
| 464 public: | 474 public: |
| 465 TestQuicSpdyServerSession(QuicConnection* connection, | 475 TestQuicSpdyServerSession(QuicConnection* connection, |
| 466 const QuicConfig& config, | 476 const QuicConfig& config, |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 TestQuicSpdyServerSession** server_session); | 791 TestQuicSpdyServerSession** server_session); |
| 782 | 792 |
| 783 // Helper to generate client side stream ids, generalizes | 793 // Helper to generate client side stream ids, generalizes |
| 784 // kClientDataStreamId1 etc. above. | 794 // kClientDataStreamId1 etc. above. |
| 785 QuicStreamId QuicClientDataStreamId(int i); | 795 QuicStreamId QuicClientDataStreamId(int i); |
| 786 | 796 |
| 787 } // namespace test | 797 } // namespace test |
| 788 } // namespace net | 798 } // namespace net |
| 789 | 799 |
| 790 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 800 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |