| 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, |
| 249 NOT_IN_FEC_GROUP), | 250 NOT_IN_FEC_GROUP), |
| 250 creator_.BytesFree()); | 251 creator_.BytesFree()); |
| 251 | 252 |
| 252 // Add a variety of frame types and then a padding frame. | 253 // Add a variety of frame types and then a padding frame. |
| 253 QuicAckFrame ack_frame; | 254 QuicAckFrame ack_frame; |
| 254 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&ack_frame))); | 255 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&ack_frame))); |
| 255 EXPECT_TRUE(creator_.HasPendingFrames()); | 256 EXPECT_TRUE(creator_.HasPendingFrames()); |
| 256 | 257 |
| 257 QuicCongestionFeedbackFrame congestion_feedback; | 258 QuicCongestionFeedbackFrame congestion_feedback; |
| 258 congestion_feedback.type = kFixRate; | 259 congestion_feedback.type = kFixRate; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 282 ASSERT_EQ(1u, retransmittable->frames().size()); | 283 ASSERT_EQ(1u, retransmittable->frames().size()); |
| 283 EXPECT_EQ(STREAM_FRAME, retransmittable->frames()[0].type); | 284 EXPECT_EQ(STREAM_FRAME, retransmittable->frames()[0].type); |
| 284 ASSERT_TRUE(retransmittable->frames()[0].stream_frame); | 285 ASSERT_TRUE(retransmittable->frames()[0].stream_frame); |
| 285 delete serialized.retransmittable_frames; | 286 delete serialized.retransmittable_frames; |
| 286 | 287 |
| 287 EXPECT_FALSE(creator_.HasPendingFrames()); | 288 EXPECT_FALSE(creator_.HasPendingFrames()); |
| 288 EXPECT_EQ(max_plaintext_size - | 289 EXPECT_EQ(max_plaintext_size - |
| 289 GetPacketHeaderSize( | 290 GetPacketHeaderSize( |
| 290 creator_.options()->send_guid_length, | 291 creator_.options()->send_guid_length, |
| 291 QuicPacketCreatorPeer::SendVersionInPacket(&creator_), | 292 QuicPacketCreatorPeer::SendVersionInPacket(&creator_), |
| 293 PACKET_6BYTE_SEQUENCE_NUMBER, |
| 292 NOT_IN_FEC_GROUP), | 294 NOT_IN_FEC_GROUP), |
| 293 creator_.BytesFree()); | 295 creator_.BytesFree()); |
| 294 } | 296 } |
| 295 | 297 |
| 296 } // namespace | 298 } // namespace |
| 297 } // namespace test | 299 } // namespace test |
| 298 } // namespace net | 300 } // namespace net |
| OLD | NEW |