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

Side by Side Diff: net/quic/core/quic_packet_generator_test.cc

Issue 2354563003: Deprecate quic_simple_packet_number_length_2. (Closed)
Patch Set: 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
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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 } 445 }
446 446
447 TEST_F(QuicPacketGeneratorTest, ConsumeData_FramesPreviouslyQueued) { 447 TEST_F(QuicPacketGeneratorTest, ConsumeData_FramesPreviouslyQueued) {
448 // Set the packet size be enough for two stream frames with 0 stream offset, 448 // Set the packet size be enough for two stream frames with 0 stream offset,
449 // but not enough for a stream frame of 0 offset and one with non-zero offset. 449 // but not enough for a stream frame of 0 offset and one with non-zero offset.
450 size_t length = 450 size_t length =
451 NullEncrypter().GetCiphertextSize(0) + 451 NullEncrypter().GetCiphertextSize(0) +
452 GetPacketHeaderSize( 452 GetPacketHeaderSize(
453 framer_.version(), creator_->connection_id_length(), kIncludeVersion, 453 framer_.version(), creator_->connection_id_length(), kIncludeVersion,
454 !kIncludePathId, !kIncludeDiversificationNonce, 454 !kIncludePathId, !kIncludeDiversificationNonce,
455 QuicPacketCreatorPeer::NextPacketNumberLength(creator_)) + 455 QuicPacketCreatorPeer::GetPacketNumberLength(creator_)) +
456 // Add an extra 3 bytes for the payload and 1 byte so BytesFree is larger 456 // Add an extra 3 bytes for the payload and 1 byte so BytesFree is larger
457 // than the GetMinStreamFrameSize. 457 // than the GetMinStreamFrameSize.
458 QuicFramer::GetMinStreamFrameSize(1, 0, false) + 3 + 458 QuicFramer::GetMinStreamFrameSize(1, 0, false) + 3 +
459 QuicFramer::GetMinStreamFrameSize(1, 0, true) + 1; 459 QuicFramer::GetMinStreamFrameSize(1, 0, true) + 1;
460 generator_.SetMaxPacketLength(length); 460 generator_.SetMaxPacketLength(length);
461 delegate_.SetCanWriteAnything(); 461 delegate_.SetCanWriteAnything();
462 { 462 {
463 InSequence dummy; 463 InSequence dummy;
464 EXPECT_CALL(delegate_, OnSerializedPacket(_)) 464 EXPECT_CALL(delegate_, OnSerializedPacket(_))
465 .WillOnce(Invoke(this, &QuicPacketGeneratorTest::SavePacket)); 465 .WillOnce(Invoke(this, &QuicPacketGeneratorTest::SavePacket));
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 EXPECT_CALL(delegate_, OnSerializedPacket(_)) 872 EXPECT_CALL(delegate_, OnSerializedPacket(_))
873 .WillOnce(Invoke(this, &QuicPacketGeneratorTest::SavePacket)); 873 .WillOnce(Invoke(this, &QuicPacketGeneratorTest::SavePacket));
874 generator_.FlushAllQueuedFrames(); 874 generator_.FlushAllQueuedFrames();
875 EXPECT_FALSE(generator_.HasQueuedFrames()); 875 EXPECT_FALSE(generator_.HasQueuedFrames());
876 generator_.SetCurrentPath(kTestPathId1, 1, 0); 876 generator_.SetCurrentPath(kTestPathId1, 1, 0);
877 EXPECT_EQ(kTestPathId1, QuicPacketCreatorPeer::GetCurrentPath(creator_)); 877 EXPECT_EQ(kTestPathId1, QuicPacketCreatorPeer::GetCurrentPath(creator_));
878 } 878 }
879 879
880 } // namespace test 880 } // namespace test
881 } // namespace net 881 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_packet_creator_test.cc ('k') | net/quic/test_tools/quic_packet_creator_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698