Lines Matching refs:creator_
72 creator_(connection_id_, &client_framer_, &mock_random_) {
105 return GetPacketHeaderSize(creator_.connection_id_length(),
107 creator_.next_sequence_number_length(),
114 return creator_.max_packet_length() - client_framer_.GetMaxPlaintextSize(
115 creator_.max_packet_length());
127 creator_.set_max_packets_per_fec_group(max_packets_per_fec_group);
128 creator_.StartFecProtectingPackets();
129 return creator_.IsFecProtected();
142 QuicPacketCreator creator_;
156 SerializedPacket serialized = creator_.SerializeAllFrames(frames_);
182 ASSERT_FALSE(creator_.ShouldSendFec(/*force_close=*/false));
185 SerializedPacket serialized = creator_.SerializeAllFrames(frames_);
204 ASSERT_FALSE(creator_.ShouldSendFec(/*force_close=*/false));
206 ASSERT_TRUE(creator_.ShouldSendFec(/*force_close=*/true));
208 serialized = creator_.SerializeFec();
226 creator_.AddSavedFrame(frames_[0]);
227 creator_.set_next_sequence_number_length(PACKET_4BYTE_SEQUENCE_NUMBER);
228 SerializedPacket serialized = creator_.SerializePacket();
245 creator_.AddSavedFrame(frames_[0]);
246 serialized = creator_.SerializePacket();
272 EXPECT_FALSE(creator_.HasPendingFrames());
274 creator_.AddSavedFrame(ack_frame);
277 creator_.set_next_sequence_number_length(PACKET_4BYTE_SEQUENCE_NUMBER);
282 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&stop_waiting_frame)));
283 EXPECT_TRUE(creator_.HasPendingFrames());
286 SerializedPacket serialized = creator_.SerializePacket();
310 EXPECT_FALSE(creator_.HasPendingFrames());
313 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&stop_waiting_frame)));
314 EXPECT_TRUE(creator_.HasPendingFrames());
317 serialized = creator_.SerializePacket();
351 ASSERT_FALSE(creator_.ShouldSendFec(/*force_close=*/false));
355 creator_.AddSavedFrame(frames_[0]);
357 creator_.set_next_sequence_number_length(PACKET_4BYTE_SEQUENCE_NUMBER);
358 SerializedPacket serialized = creator_.SerializePacket();
376 creator_.AddSavedFrame(frames_[0]);
377 serialized = creator_.SerializePacket();
396 ASSERT_FALSE(creator_.ShouldSendFec(/*force_close=*/false));
398 ASSERT_TRUE(creator_.ShouldSendFec(/*force_close=*/true));
401 serialized = creator_.SerializeFec();
419 creator_.SerializeAllFrames(frames_);
429 creator_.set_next_sequence_number_length(PACKET_4BYTE_SEQUENCE_NUMBER);
430 QuicPacketCreatorPeer::SetSequenceNumberLength(&creator_,
434 creator_.ReserializeAllFrames(frames_, PACKET_1BYTE_SEQUENCE_NUMBER);
436 creator_.next_sequence_number_length());
438 QuicPacketCreatorPeer::GetSequenceNumberLength(&creator_));
462 creator_.ReserializeAllFrames(frames_,
463 creator_.next_sequence_number_length());
483 creator_.ReserializeAllFrames(frames_,
484 creator_.next_sequence_number_length());
507 SerializedPacket serialized = creator_.SerializeConnectionClose(&frame);
509 ASSERT_EQ(1u, creator_.sequence_number());
526 creator_.set_max_packets_per_fec_group(6);
527 EXPECT_TRUE(creator_.IsFecEnabled());
528 EXPECT_FALSE(creator_.IsFecProtected());
531 creator_.StartFecProtectingPackets();
532 EXPECT_TRUE(creator_.IsFecProtected());
534 EXPECT_FALSE(creator_.ShouldSendFec(/*force_close=*/true));
537 creator_.StopFecProtectingPackets();
538 EXPECT_FALSE(creator_.IsFecProtected());
545 SerializedPacket serialized = creator_.SerializeAllFrames(frames_);
549 EXPECT_TRUE(creator_.IsFecProtected());
551 EXPECT_FALSE(creator_.ShouldSendFec(/*force_close=*/false));
553 EXPECT_TRUE(creator_.ShouldSendFec(/*force_close=*/true));
557 EXPECT_DFATAL(creator_.StopFecProtectingPackets(),
559 EXPECT_TRUE(creator_.IsFecProtected());
561 EXPECT_TRUE(creator_.ShouldSendFec(/*force_close=*/true));
563 serialized = creator_.SerializeFec();
567 creator_.StopFecProtectingPackets();
568 EXPECT_FALSE(creator_.IsFecProtected());
569 creator_.StartFecProtectingPackets();
570 EXPECT_TRUE(creator_.IsFecProtected());
576 size_t consumed = creator_.CreateStreamFrame(
580 EXPECT_TRUE(creator_.AddSavedFrame(frame));
581 EXPECT_TRUE(creator_.HasPendingFrames());
584 creator_.set_max_packets_per_fec_group(6);
585 EXPECT_TRUE(creator_.IsFecEnabled());
586 EXPECT_DFATAL(creator_.StartFecProtectingPackets(),
588 EXPECT_FALSE(creator_.IsFecProtected());
591 SerializedPacket serialized = creator_.SerializePacket();
594 EXPECT_FALSE(creator_.HasPendingFrames());
597 creator_.StartFecProtectingPackets();
598 EXPECT_TRUE(creator_.IsFecProtected());
603 size_t consumed = creator_.CreateStreamFrame(1u, MakeIOVector("test"), 0u,
612 size_t consumed = creator_.CreateStreamFrame(1u, MakeIOVector("test"), 10u,
621 size_t consumed = creator_.CreateStreamFrame(1u, IOVector(), 0u, true,
632 creator_.set_max_packet_length(i);
635 ASSERT_EQ(should_have_room, creator_.HasRoomForStreamFrame(
639 size_t bytes_consumed = creator_.CreateStreamFrame(
643 ASSERT_TRUE(creator_.AddSavedFrame(frame));
644 SerializedPacket serialized_packet = creator_.SerializePacket();
662 size_t bytes_consumed = creator_.CreateStreamFrame(
666 ASSERT_TRUE(creator_.AddSavedFrame(frame));
669 EXPECT_EQ(2u, creator_.ExpansionOnNewFrame());
671 EXPECT_EQ(expected_bytes_free, creator_.BytesFree()) << "delta: " << delta;
672 SerializedPacket serialized_packet = creator_.SerializePacket();
691 size_t bytes_consumed = creator_.CreateStreamFrame(
695 ASSERT_TRUE(creator_.AddSavedFrame(frame));
699 EXPECT_EQ(0u, creator_.ExpansionOnNewFrame());
701 EXPECT_EQ(expected_bytes_free, creator_.BytesFree()) << "delta: " << delta;
702 SerializedPacket serialized_packet = creator_.SerializePacket();
721 size_t bytes_consumed = creator_.CreateStreamFrame(
724 ASSERT_TRUE(creator_.AddSavedFrame(frame));
725 SerializedPacket serialized_packet = creator_.SerializePacket();
754 size_t bytes_consumed = creator_.CreateStreamFrame(
757 ASSERT_TRUE(creator_.AddSavedFrame(frame));
758 SerializedPacket serialized_packet = creator_.SerializePacket();
777 creator_.SerializeVersionNegotiationPacket(versions));
791 creator_.next_sequence_number_length());
794 creator_.set_max_packets_per_fec_group(max_packets_per_fec_group);
795 creator_.set_sequence_number(64 - max_packets_per_fec_group);
796 creator_.UpdateSequenceNumberLength(2, 10000);
798 creator_.next_sequence_number_length());
800 creator_.set_sequence_number(64 * 256 - max_packets_per_fec_group);
801 creator_.UpdateSequenceNumberLength(2, 10000);
803 creator_
805 creator_.set_sequence_number(64 * 256 * 256 - max_packets_per_fec_group);
806 creator_.UpdateSequenceNumberLength(2, 10000);
808 creator_.next_sequence_number_length());
810 creator_.set_sequence_number(
812 creator_.UpdateSequenceNumberLength(2, 10000);
814 creator_.next_sequence_number_length());
819 creator_.next_sequence_number_length());
821 creator_.UpdateSequenceNumberLength(1, 10000);
823 creator_.next_sequence_number_length());
825 creator_.UpdateSequenceNumberLength(1, 10000 * 256);
827 creator_.next_sequence_number_length());
829 creator_.UpdateSequenceNumberLength(1, 10000 * 256 * 256);
831 creator_.next_sequence_number_length());
833 creator_.UpdateSequenceNumberLength(
836 creator_.next_sequence_number_length());
848 size_t consumed_bytes = creator_.CreateStreamFrameWithNotifier(
857 creator_.StopSendingVersion();
860 SerializedPacket serialized = creator_.SerializeAllFrames(frames_);
883 creator_.StopSendingVersion();
887 creator_.set_max_packet_length(GetPacketLengthForOneStream(
889 QuicPacketCreatorPeer::SendVersionInPacket(&creator_),
893 size_t consumed = creator_.CreateStreamFrame(
903 creator_.StopSendingVersion();
906 client_framer_.GetMaxPlaintextSize(creator_.max_packet_length());
907 EXPECT_FALSE(creator_.HasPendingFrames());
910 creator_.connection_id_length(),
911 QuicPacketCreatorPeer::SendVersionInPacket(&creator_),
913 creator_.BytesFree());
917 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&ack_frame)));
918 EXPECT_TRUE(creator_.HasPendingFrames());
923 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&congestion_feedback)));
924 EXPECT_TRUE(creator_.HasPendingFrames());
927 size_t consumed = creator_.CreateStreamFrame(
931 EXPECT_TRUE(creator_.AddSavedFrame(frame));
932 EXPECT_TRUE(creator_.HasPendingFrames());
935 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&padding_frame)));
936 EXPECT_TRUE(creator_.HasPendingFrames());
937 EXPECT_EQ(0u, creator_.BytesFree());
939 EXPECT_FALSE(creator_.AddSavedFrame(QuicFrame(&ack_frame)));
942 SerializedPacket serialized = creator_.SerializePacket();
952 EXPECT_FALSE(creator_.HasPendingFrames());
955 creator_.connection_id_length(),
956 QuicPacketCreatorPeer::SendVersionInPacket(&creator_),
959 creator_.BytesFree());
964 creator_.StopSendingVersion();
966 creator_.set_max_packet_length(kMaxPacketSize);
968 client_framer_.GetMaxPlaintextSize(creator_.max_packet_length());
974 QuicFrame(&ack_frame), creator_.BytesFree(), true, true,
976 EXPECT_GT(creator_.BytesFree(), frame_len);
977 EXPECT_GT(max_plaintext_size, creator_.PacketSize());
980 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&ack_frame)));
981 EXPECT_TRUE(creator_.HasPendingFrames());
982 EXPECT_GT(max_plaintext_size, creator_.PacketSize());
983 EXPECT_LT(0u, creator_.BytesFree());
987 size_t consumed = creator_.CreateStreamFrame(
991 EXPECT_TRUE(creator_.AddSavedFrame(stream_frame));
992 EXPECT_TRUE(creator_.HasPendingFrames());
998 size_t est_packet_size = creator_.PacketSize();
999 SerializedPacket serialized = creator_.SerializePacket();
1008 creator_.StopSendingVersion();
1010 creator_.set_max_packet_length(500u);
1013 client_framer_.GetMaxPlaintextSize(creator_.max_packet_length());
1014 EXPECT_EQ(max_plaintext_size - creator_.PacketSize(), creator_.BytesFree());
1020 QuicFrame(&ack_frame), creator_.BytesFree(), true, true,
1022 EXPECT_EQ(creator_.BytesFree(), frame_len);
1025 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&ack_frame)));
1026 EXPECT_TRUE(creator_.HasPendingFrames());
1027 EXPECT_EQ(max_plaintext_size, creator_.PacketSize());
1028 EXPECT_EQ(0u, creator_.BytesFree());
1034 size_t est_packet_size = creator_.PacketSize();
1035 SerializedPacket serialized = creator_.SerializePacket();
1047 SerializedPacket serialized = creator_.SerializeAllFrames(frames_);