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" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 bool should_include_version, | 61 bool should_include_version, |
62 bool fin, | 62 bool fin, |
63 const SpdyHeaderBlock& headers); | 63 const SpdyHeaderBlock& headers); |
64 | 64 |
65 SpdyHeaderBlock GetRequestHeaders(const std::string& method, | 65 SpdyHeaderBlock GetRequestHeaders(const std::string& method, |
66 const std::string& scheme, | 66 const std::string& scheme, |
67 const std::string& path); | 67 const std::string& path); |
68 SpdyHeaderBlock GetResponseHeaders(const std::string& status); | 68 SpdyHeaderBlock GetResponseHeaders(const std::string& status); |
69 | 69 |
70 private: | 70 private: |
71 scoped_ptr<QuicEncryptedPacket> MakePacket( | 71 scoped_ptr<QuicEncryptedPacket> MakePacket(const QuicPacketHeader& header, |
72 const QuicPacketHeader& header, | 72 const QuicFrame& frame); |
73 const QuicFrame& frame); | |
74 | 73 |
75 void InitializeHeader(QuicPacketSequenceNumber sequence_number, | 74 void InitializeHeader(QuicPacketSequenceNumber sequence_number, |
76 bool should_include_version); | 75 bool should_include_version); |
77 | 76 |
78 QuicVersion version_; | 77 QuicVersion version_; |
79 QuicConnectionId connection_id_; | 78 QuicConnectionId connection_id_; |
80 SpdyFramer spdy_request_framer_; | 79 SpdyFramer spdy_request_framer_; |
81 SpdyFramer spdy_response_framer_; | 80 SpdyFramer spdy_response_framer_; |
82 MockRandom random_generator_; | 81 MockRandom random_generator_; |
83 QuicPacketHeader header_; | 82 QuicPacketHeader header_; |
84 | 83 |
85 DISALLOW_COPY_AND_ASSIGN(QuicTestPacketMaker); | 84 DISALLOW_COPY_AND_ASSIGN(QuicTestPacketMaker); |
86 }; | 85 }; |
87 | 86 |
88 } // namespace test | 87 } // namespace test |
89 } // namespace net | 88 } // namespace net |
90 | 89 |
91 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_ | 90 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_PACKET_MAKER_H_ |
OLD | NEW |