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/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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 TEST_P(QuicPacketCreatorTest, ReserializeFramesWithFullPacketAndPadding) { | 578 TEST_P(QuicPacketCreatorTest, ReserializeFramesWithFullPacketAndPadding) { |
579 const size_t overhead = GetPacketHeaderOverhead(client_framer_.version()) + | 579 const size_t overhead = GetPacketHeaderOverhead(client_framer_.version()) + |
580 GetEncryptionOverhead() + GetStreamFrameOverhead(); | 580 GetEncryptionOverhead() + GetStreamFrameOverhead(); |
581 size_t capacity = kDefaultMaxPacketSize - overhead; | 581 size_t capacity = kDefaultMaxPacketSize - overhead; |
582 for (int delta = -5; delta <= 0; ++delta) { | 582 for (int delta = -5; delta <= 0; ++delta) { |
583 string data(capacity + delta, 'A'); | 583 string data(capacity + delta, 'A'); |
584 size_t bytes_free = 0 - delta; | 584 size_t bytes_free = 0 - delta; |
585 | 585 |
586 QuicFrame frame; | 586 QuicFrame frame; |
587 QuicIOVector io_vector(MakeIOVector(data)); | 587 QuicIOVector io_vector(MakeIOVector(data)); |
588 UniqueStreamBuffer stream_buffer; | |
589 QuicPacketCreatorPeer::CreateStreamFrame( | 588 QuicPacketCreatorPeer::CreateStreamFrame( |
590 &creator_, kCryptoStreamId, io_vector, 0, kOffset, false, &frame); | 589 &creator_, kCryptoStreamId, io_vector, 0, kOffset, false, &frame); |
591 QuicFrames frames; | 590 QuicFrames frames; |
592 frames.push_back(frame); | 591 frames.push_back(frame); |
593 char buffer[kMaxPacketSize]; | 592 char buffer[kMaxPacketSize]; |
594 PendingRetransmission retransmission(CreateRetransmission( | 593 PendingRetransmission retransmission(CreateRetransmission( |
595 frames, true /* has_crypto_handshake */, -1 /* needs full padding */, | 594 frames, true /* has_crypto_handshake */, -1 /* needs full padding */, |
596 ENCRYPTION_NONE, | 595 ENCRYPTION_NONE, |
597 QuicPacketCreatorPeer::GetPacketNumberLength(&creator_))); | 596 QuicPacketCreatorPeer::GetPacketNumberLength(&creator_))); |
598 EXPECT_CALL(delegate_, OnSerializedPacket(_)) | 597 EXPECT_CALL(delegate_, OnSerializedPacket(_)) |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 EXPECT_CALL(delegate_, | 1326 EXPECT_CALL(delegate_, |
1328 OnUnrecoverableError(QUIC_CRYPTO_CHLO_TOO_LARGE, _, _)); | 1327 OnUnrecoverableError(QUIC_CRYPTO_CHLO_TOO_LARGE, _, _)); |
1329 EXPECT_QUIC_BUG( | 1328 EXPECT_QUIC_BUG( |
1330 creator_.ConsumeData(1u, data_iovec, 0u, 0u, false, false, &frame), | 1329 creator_.ConsumeData(1u, data_iovec, 0u, 0u, false, false, &frame), |
1331 "Client hello won't fit in a single packet."); | 1330 "Client hello won't fit in a single packet."); |
1332 } | 1331 } |
1333 | 1332 |
1334 } // namespace | 1333 } // namespace |
1335 } // namespace test | 1334 } // namespace test |
1336 } // namespace net | 1335 } // namespace net |
OLD | NEW |