| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Provides a simple interface for QUIC tests to create a variety of packets. | 5 // Provides a simple interface for QUIC tests to create a variety of packets. |
| 6 | 6 |
| 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_ | 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_ |
| 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_ | 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_ |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "net/base/request_priority.h" | 11 #include "net/base/request_priority.h" |
| 12 #include "net/quic/quic_protocol.h" | 12 #include "net/quic/quic_protocol.h" |
| 13 #include "net/quic/test_tools/mock_clock.h" | 13 #include "net/quic/test_tools/mock_clock.h" |
| 14 #include "net/quic/test_tools/mock_random.h" | 14 #include "net/quic/test_tools/mock_random.h" |
| 15 #include "net/spdy/spdy_framer.h" | 15 #include "net/spdy/spdy_framer.h" |
| 16 #include "net/spdy/spdy_protocol.h" | 16 #include "net/spdy/spdy_protocol.h" |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 namespace test { | 19 namespace test { |
| 20 | 20 |
| 21 class QuicTestPacketMaker { | 21 class QuicTestPacketMaker { |
| 22 public: | 22 public: |
| 23 QuicTestPacketMaker(QuicVersion version, | 23 QuicTestPacketMaker(QuicVersion version, |
| 24 QuicConnectionId connection_id, | 24 QuicConnectionId connection_id, |
| 25 MockClock* clock, | 25 MockClock* clock, |
| 26 const std::string& host); | 26 const std::string& host); |
| 27 ~QuicTestPacketMaker(); | 27 ~QuicTestPacketMaker(); |
| 28 | 28 |
| 29 void set_hostname(const std::string& host); | 29 void set_hostname(const std::string& host); |
| 30 scoped_ptr<QuicEncryptedPacket> MakePingPacket(QuicPacketNumber num, |
| 31 bool include_version); |
| 30 scoped_ptr<QuicEncryptedPacket> MakeRstPacket( | 32 scoped_ptr<QuicEncryptedPacket> MakeRstPacket( |
| 31 QuicPacketNumber num, | 33 QuicPacketNumber num, |
| 32 bool include_version, | 34 bool include_version, |
| 33 QuicStreamId stream_id, | 35 QuicStreamId stream_id, |
| 34 QuicRstStreamErrorCode error_code); | 36 QuicRstStreamErrorCode error_code); |
| 35 scoped_ptr<QuicEncryptedPacket> MakeAckAndRstPacket( | 37 scoped_ptr<QuicEncryptedPacket> MakeAckAndRstPacket( |
| 36 QuicPacketNumber num, | 38 QuicPacketNumber num, |
| 37 bool include_version, | 39 bool include_version, |
| 38 QuicStreamId stream_id, | 40 QuicStreamId stream_id, |
| 39 QuicRstStreamErrorCode error_code, | 41 QuicRstStreamErrorCode error_code, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 MockRandom random_generator_; | 126 MockRandom random_generator_; |
| 125 QuicPacketHeader header_; | 127 QuicPacketHeader header_; |
| 126 | 128 |
| 127 DISALLOW_COPY_AND_ASSIGN(QuicTestPacketMaker); | 129 DISALLOW_COPY_AND_ASSIGN(QuicTestPacketMaker); |
| 128 }; | 130 }; |
| 129 | 131 |
| 130 } // namespace test | 132 } // namespace test |
| 131 } // namespace net | 133 } // namespace net |
| 132 | 134 |
| 133 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_ | 135 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_ |
| OLD | NEW |