| 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_generator.h" | 5 #include "net/quic/quic_packet_generator.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "net/quic/crypto/crypto_protocol.h" | 9 #include "net/quic/crypto/crypto_protocol.h" |
| 10 #include "net/quic/crypto/null_encrypter.h" | 10 #include "net/quic/crypto/null_encrypter.h" |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 CheckPacketHasSingleStreamFrame(packet_); | 498 CheckPacketHasSingleStreamFrame(packet_); |
| 499 CheckPacketHasSingleStreamFrame(packet2_); | 499 CheckPacketHasSingleStreamFrame(packet2_); |
| 500 CheckPacketIsFec(packet3_, 1); | 500 CheckPacketIsFec(packet3_, 1); |
| 501 } | 501 } |
| 502 | 502 |
| 503 TEST_F(QuicPacketGeneratorTest, ConsumeData_FramesPreviouslyQueued) { | 503 TEST_F(QuicPacketGeneratorTest, ConsumeData_FramesPreviouslyQueued) { |
| 504 // Set the packet size be enough for two stream frames with 0 stream offset, | 504 // Set the packet size be enough for two stream frames with 0 stream offset, |
| 505 // but not enough for a stream frame of 0 offset and one with non-zero offset. | 505 // but not enough for a stream frame of 0 offset and one with non-zero offset. |
| 506 creator_.options()->max_packet_length = | 506 creator_.options()->max_packet_length = |
| 507 NullEncrypter().GetCiphertextSize(0) + | 507 NullEncrypter().GetCiphertextSize(0) + |
| 508 GetPacketHeaderSize(creator_.options()->send_guid_length, | 508 GetPacketHeaderSize(creator_.options()->send_connection_id_length, |
| 509 true, | 509 true, |
| 510 creator_.options()->send_sequence_number_length, | 510 creator_.options()->send_sequence_number_length, |
| 511 NOT_IN_FEC_GROUP) + | 511 NOT_IN_FEC_GROUP) + |
| 512 // Add an extra 3 bytes for the payload and 1 byte so BytesFree is larger | 512 // Add an extra 3 bytes for the payload and 1 byte so BytesFree is larger |
| 513 // than the GetMinStreamFrameSize. | 513 // than the GetMinStreamFrameSize. |
| 514 QuicFramer::GetMinStreamFrameSize(framer_.version(), 1, 0, false) + 3 + | 514 QuicFramer::GetMinStreamFrameSize(framer_.version(), 1, 0, false) + 3 + |
| 515 QuicFramer::GetMinStreamFrameSize(framer_.version(), 1, 0, true) + 1; | 515 QuicFramer::GetMinStreamFrameSize(framer_.version(), 1, 0, true) + 1; |
| 516 delegate_.SetCanWriteAnything(); | 516 delegate_.SetCanWriteAnything(); |
| 517 { | 517 { |
| 518 InSequence dummy; | 518 InSequence dummy; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 | 627 |
| 628 // The second should have the remainder of the stream data. | 628 // The second should have the remainder of the stream data. |
| 629 PacketContents contents2; | 629 PacketContents contents2; |
| 630 contents2.num_goaway_frames = 1; | 630 contents2.num_goaway_frames = 1; |
| 631 contents2.num_stream_frames = 1; | 631 contents2.num_stream_frames = 1; |
| 632 CheckPacketContains(contents2, packet2_); | 632 CheckPacketContains(contents2, packet2_); |
| 633 } | 633 } |
| 634 | 634 |
| 635 } // namespace test | 635 } // namespace test |
| 636 } // namespace net | 636 } // namespace net |
| OLD | NEW |