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

Side by Side Diff: net/quic/core/quic_packet_creator_test.cc

Issue 2306173003: Add a new QuicFlagSaver class for saving/restoring the values of QUIC flags in tests. (Closed)
Patch Set: Better Created 4 years, 3 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
« no previous file with comments | « net/quic/core/quic_headers_stream_test.cc ('k') | net/quic/core/quic_packet_generator_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "net/quic/core/quic_packet_creator.h" 5 #include "net/quic/core/quic_packet_creator.h"
6 6
7 #include <cstdint> 7 #include <cstdint>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 EncryptionLevel encryption_level, 216 EncryptionLevel encryption_level,
217 QuicPacketNumberLength packet_number_length) { 217 QuicPacketNumberLength packet_number_length) {
218 return PendingRetransmission(1u, 1u, NOT_RETRANSMISSION, 218 return PendingRetransmission(1u, 1u, NOT_RETRANSMISSION,
219 retransmittable_frames, has_crypto_handshake, 219 retransmittable_frames, has_crypto_handshake,
220 num_padding_bytes, encryption_level, 220 num_padding_bytes, encryption_level,
221 packet_number_length); 221 packet_number_length);
222 } 222 }
223 223
224 static const QuicStreamOffset kOffset = 1u; 224 static const QuicStreamOffset kOffset = 1u;
225 225
226 QuicFlagSaver flags_; // Save/restore all QUIC flag values.
226 char buffer_[kMaxPacketSize]; 227 char buffer_[kMaxPacketSize];
227 QuicFrames frames_; 228 QuicFrames frames_;
228 QuicFramer server_framer_; 229 QuicFramer server_framer_;
229 QuicFramer client_framer_; 230 QuicFramer client_framer_;
230 StrictMock<MockFramerVisitor> framer_visitor_; 231 StrictMock<MockFramerVisitor> framer_visitor_;
231 StrictMock<MockDelegate> delegate_; 232 StrictMock<MockDelegate> delegate_;
232 QuicConnectionId connection_id_; 233 QuicConnectionId connection_id_;
233 string data_; 234 string data_;
234 struct iovec iov_; 235 struct iovec iov_;
235 MockRandom mock_random_; 236 MockRandom mock_random_;
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 EXPECT_CALL(delegate_, 1327 EXPECT_CALL(delegate_,
1327 OnUnrecoverableError(QUIC_CRYPTO_CHLO_TOO_LARGE, _, _)); 1328 OnUnrecoverableError(QUIC_CRYPTO_CHLO_TOO_LARGE, _, _));
1328 EXPECT_QUIC_BUG( 1329 EXPECT_QUIC_BUG(
1329 creator_.ConsumeData(1u, data_iovec, 0u, 0u, false, false, &frame), 1330 creator_.ConsumeData(1u, data_iovec, 0u, 0u, false, false, &frame),
1330 "Client hello won't fit in a single packet."); 1331 "Client hello won't fit in a single packet.");
1331 } 1332 }
1332 1333
1333 } // namespace 1334 } // namespace
1334 } // namespace test 1335 } // namespace test
1335 } // namespace net 1336 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_headers_stream_test.cc ('k') | net/quic/core/quic_packet_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698