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

Side by Side Diff: net/quic/core/quic_packet_generator_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_packet_creator_test.cc ('k') | net/quic/core/quic_protocol_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_generator.h" 5 #include "net/quic/core/quic_packet_generator.h"
6 6
7 #include <cstdint> 7 #include <cstdint>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 memset(data_array_.get(), '?', len); 200 memset(data_array_.get(), '?', len);
201 iov_.iov_base = data_array_.get(); 201 iov_.iov_base = data_array_.get();
202 iov_.iov_len = len; 202 iov_.iov_len = len;
203 return QuicIOVector(&iov_, 1, len); 203 return QuicIOVector(&iov_, 1, len);
204 } 204 }
205 205
206 QuicIOVector MakeIOVector(StringPiece s) { 206 QuicIOVector MakeIOVector(StringPiece s) {
207 return ::net::MakeIOVector(s, &iov_); 207 return ::net::MakeIOVector(s, &iov_);
208 } 208 }
209 209
210 QuicFlagSaver flags_; // Save/restore all QUIC flag values.
210 QuicFramer framer_; 211 QuicFramer framer_;
211 MockRandom random_; 212 MockRandom random_;
212 SimpleBufferAllocator buffer_allocator_; 213 SimpleBufferAllocator buffer_allocator_;
213 StrictMock<MockDelegate> delegate_; 214 StrictMock<MockDelegate> delegate_;
214 QuicPacketGenerator generator_; 215 QuicPacketGenerator generator_;
215 QuicPacketCreator* creator_; 216 QuicPacketCreator* creator_;
216 SimpleQuicFramer simple_framer_; 217 SimpleQuicFramer simple_framer_;
217 vector<SerializedPacket> packets_; 218 vector<SerializedPacket> packets_;
218 QuicAckFrame ack_frame_; 219 QuicAckFrame ack_frame_;
219 220
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 EXPECT_CALL(delegate_, OnSerializedPacket(_)) 872 EXPECT_CALL(delegate_, OnSerializedPacket(_))
872 .WillOnce(Invoke(this, &QuicPacketGeneratorTest::SavePacket)); 873 .WillOnce(Invoke(this, &QuicPacketGeneratorTest::SavePacket));
873 generator_.FlushAllQueuedFrames(); 874 generator_.FlushAllQueuedFrames();
874 EXPECT_FALSE(generator_.HasQueuedFrames()); 875 EXPECT_FALSE(generator_.HasQueuedFrames());
875 generator_.SetCurrentPath(kTestPathId1, 1, 0); 876 generator_.SetCurrentPath(kTestPathId1, 1, 0);
876 EXPECT_EQ(kTestPathId1, QuicPacketCreatorPeer::GetCurrentPath(creator_)); 877 EXPECT_EQ(kTestPathId1, QuicPacketCreatorPeer::GetCurrentPath(creator_));
877 } 878 }
878 879
879 } // namespace test 880 } // namespace test
880 } // namespace net 881 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_packet_creator_test.cc ('k') | net/quic/core/quic_protocol_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698