Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: net/quic/chromium/quic_test_packet_maker.h

Issue 2838113002: Simplify QUIC tests by adding a MakeInitialSettingsPacket method (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_CHROMIUM_QUIC_TEST_PACKET_MAKER_H_ 7 #ifndef NET_QUIC_CHROMIUM_QUIC_TEST_PACKET_MAKER_H_
8 #define NET_QUIC_CHROMIUM_QUIC_TEST_PACKET_MAKER_H_ 8 #define NET_QUIC_CHROMIUM_QUIC_TEST_PACKET_MAKER_H_
9 9
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 // Convenience method for calling MakeResponseHeadersPacket with nullptr for 209 // Convenience method for calling MakeResponseHeadersPacket with nullptr for
210 // |spdy_headers_frame_length|. 210 // |spdy_headers_frame_length|.
211 std::unique_ptr<QuicReceivedPacket> 211 std::unique_ptr<QuicReceivedPacket>
212 MakeResponseHeadersPacketWithOffsetTracking(QuicPacketNumber packet_number, 212 MakeResponseHeadersPacketWithOffsetTracking(QuicPacketNumber packet_number,
213 QuicStreamId stream_id, 213 QuicStreamId stream_id,
214 bool should_include_version, 214 bool should_include_version,
215 bool fin, 215 bool fin,
216 SpdyHeaderBlock headers, 216 SpdyHeaderBlock headers,
217 QuicStreamOffset* offset); 217 QuicStreamOffset* offset);
218 218
219 std::unique_ptr<QuicReceivedPacket> MakeSettingsPacket( 219 // Creates a packet containing the initial SETTINGS frame, and saves the
220 // headers stream offset into |offset|.
221 std::unique_ptr<QuicReceivedPacket> MakeInitialSettingsPacket(
220 QuicPacketNumber packet_number, 222 QuicPacketNumber packet_number,
221 SpdySettingsIds id,
222 size_t value,
223 bool should_include_version,
224 QuicStreamOffset* offset); 223 QuicStreamOffset* offset);
225 224
226 // Same as above, but also saves the serialized QUIC stream data in 225 // Same as above, but also saves the serialized QUIC stream data in
227 // |stream_data|. 226 // |stream_data|.
228 std::unique_ptr<QuicReceivedPacket> MakeSettingsPacketAndSaveData( 227 std::unique_ptr<QuicReceivedPacket> MakeInitialSettingsPacketAndSaveData(
229 QuicPacketNumber packet_number, 228 QuicPacketNumber packet_number,
230 SpdySettingsIds id,
231 size_t value,
232 bool should_include_version,
233 QuicStreamOffset* offset, 229 QuicStreamOffset* offset,
234 std::string* stream_data); 230 std::string* stream_data);
235 231
236 SpdyHeaderBlock GetRequestHeaders(const std::string& method, 232 SpdyHeaderBlock GetRequestHeaders(const std::string& method,
237 const std::string& scheme, 233 const std::string& scheme,
238 const std::string& path); 234 const std::string& path);
239 SpdyHeaderBlock GetResponseHeaders(const std::string& status); 235 SpdyHeaderBlock GetResponseHeaders(const std::string& status);
240 236
241 SpdyHeaderBlock GetResponseHeaders(const std::string& status, 237 SpdyHeaderBlock GetResponseHeaders(const std::string& status,
242 const std::string& alt_svc); 238 const std::string& alt_svc);
(...skipping 18 matching lines...) Expand all
261 QuicPacketHeader header_; 257 QuicPacketHeader header_;
262 Perspective perspective_; 258 Perspective perspective_;
263 259
264 DISALLOW_COPY_AND_ASSIGN(QuicTestPacketMaker); 260 DISALLOW_COPY_AND_ASSIGN(QuicTestPacketMaker);
265 }; 261 };
266 262
267 } // namespace test 263 } // namespace test
268 } // namespace net 264 } // namespace net
269 265
270 #endif // NET_QUIC_CHROMIUM_QUIC_TEST_PACKET_MAKER_H_ 266 #endif // NET_QUIC_CHROMIUM_QUIC_TEST_PACKET_MAKER_H_
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_stream_factory_test.cc ('k') | net/quic/chromium/quic_test_packet_maker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698