| OLD | NEW |
| 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/quic_packet_creator.h" | 5 #include "net/quic/quic_packet_creator.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "net/quic/crypto/null_encrypter.h" | 8 #include "net/quic/crypto/null_encrypter.h" |
| 9 #include "net/quic/crypto/quic_decrypter.h" | 9 #include "net/quic/crypto/quic_decrypter.h" |
| 10 #include "net/quic/crypto/quic_encrypter.h" | 10 #include "net/quic/crypto/quic_encrypter.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 if (!GetParam()) { | 239 if (!GetParam()) { |
| 240 creator_.StopSendingVersion(); | 240 creator_.StopSendingVersion(); |
| 241 } | 241 } |
| 242 const size_t max_plaintext_size = | 242 const size_t max_plaintext_size = |
| 243 client_framer_.GetMaxPlaintextSize(creator_.options()->max_packet_length); | 243 client_framer_.GetMaxPlaintextSize(creator_.options()->max_packet_length); |
| 244 EXPECT_FALSE(creator_.HasPendingFrames()); | 244 EXPECT_FALSE(creator_.HasPendingFrames()); |
| 245 EXPECT_EQ(max_plaintext_size - | 245 EXPECT_EQ(max_plaintext_size - |
| 246 GetPacketHeaderSize( | 246 GetPacketHeaderSize( |
| 247 creator_.options()->send_guid_length, | 247 creator_.options()->send_guid_length, |
| 248 QuicPacketCreatorPeer::SendVersionInPacket(&creator_), | 248 QuicPacketCreatorPeer::SendVersionInPacket(&creator_), |
| 249 PACKET_6BYTE_SEQUENCE_NUMBER, | |
| 250 NOT_IN_FEC_GROUP), | 249 NOT_IN_FEC_GROUP), |
| 251 creator_.BytesFree()); | 250 creator_.BytesFree()); |
| 252 | 251 |
| 253 // Add a variety of frame types and then a padding frame. | 252 // Add a variety of frame types and then a padding frame. |
| 254 QuicAckFrame ack_frame; | 253 QuicAckFrame ack_frame; |
| 255 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&ack_frame))); | 254 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&ack_frame))); |
| 256 EXPECT_TRUE(creator_.HasPendingFrames()); | 255 EXPECT_TRUE(creator_.HasPendingFrames()); |
| 257 | 256 |
| 258 QuicCongestionFeedbackFrame congestion_feedback; | 257 QuicCongestionFeedbackFrame congestion_feedback; |
| 259 congestion_feedback.type = kFixRate; | 258 congestion_feedback.type = kFixRate; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 283 ASSERT_EQ(1u, retransmittable->frames().size()); | 282 ASSERT_EQ(1u, retransmittable->frames().size()); |
| 284 EXPECT_EQ(STREAM_FRAME, retransmittable->frames()[0].type); | 283 EXPECT_EQ(STREAM_FRAME, retransmittable->frames()[0].type); |
| 285 ASSERT_TRUE(retransmittable->frames()[0].stream_frame); | 284 ASSERT_TRUE(retransmittable->frames()[0].stream_frame); |
| 286 delete serialized.retransmittable_frames; | 285 delete serialized.retransmittable_frames; |
| 287 | 286 |
| 288 EXPECT_FALSE(creator_.HasPendingFrames()); | 287 EXPECT_FALSE(creator_.HasPendingFrames()); |
| 289 EXPECT_EQ(max_plaintext_size - | 288 EXPECT_EQ(max_plaintext_size - |
| 290 GetPacketHeaderSize( | 289 GetPacketHeaderSize( |
| 291 creator_.options()->send_guid_length, | 290 creator_.options()->send_guid_length, |
| 292 QuicPacketCreatorPeer::SendVersionInPacket(&creator_), | 291 QuicPacketCreatorPeer::SendVersionInPacket(&creator_), |
| 293 PACKET_6BYTE_SEQUENCE_NUMBER, | |
| 294 NOT_IN_FEC_GROUP), | 292 NOT_IN_FEC_GROUP), |
| 295 creator_.BytesFree()); | 293 creator_.BytesFree()); |
| 296 } | 294 } |
| 297 | 295 |
| 298 } // namespace | 296 } // namespace |
| 299 } // namespace test | 297 } // namespace test |
| 300 } // namespace net | 298 } // namespace net |
| OLD | NEW |