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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 creator_.connection_id_length(), | 908 creator_.connection_id_length(), |
909 QuicPacketCreatorPeer::SendVersionInPacket(&creator_), | 909 QuicPacketCreatorPeer::SendVersionInPacket(&creator_), |
910 PACKET_1BYTE_SEQUENCE_NUMBER, NOT_IN_FEC_GROUP), | 910 PACKET_1BYTE_SEQUENCE_NUMBER, NOT_IN_FEC_GROUP), |
911 creator_.BytesFree()); | 911 creator_.BytesFree()); |
912 | 912 |
913 // Add a variety of frame types and then a padding frame. | 913 // Add a variety of frame types and then a padding frame. |
914 QuicAckFrame ack_frame(MakeAckFrame(0u)); | 914 QuicAckFrame ack_frame(MakeAckFrame(0u)); |
915 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&ack_frame))); | 915 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&ack_frame))); |
916 EXPECT_TRUE(creator_.HasPendingFrames()); | 916 EXPECT_TRUE(creator_.HasPendingFrames()); |
917 | 917 |
918 QuicCongestionFeedbackFrame congestion_feedback; | |
919 congestion_feedback.type = kTCP; | |
920 congestion_feedback.tcp.receive_window = 0x4030; | |
921 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&congestion_feedback))); | |
922 EXPECT_TRUE(creator_.HasPendingFrames()); | |
923 | |
924 QuicFrame frame; | 918 QuicFrame frame; |
925 size_t consumed = creator_.CreateStreamFrame( | 919 size_t consumed = creator_.CreateStreamFrame( |
926 1u, MakeIOVector("test"), 0u, false, &frame); | 920 1u, MakeIOVector("test"), 0u, false, &frame); |
927 EXPECT_EQ(4u, consumed); | 921 EXPECT_EQ(4u, consumed); |
928 ASSERT_TRUE(frame.stream_frame); | 922 ASSERT_TRUE(frame.stream_frame); |
929 EXPECT_TRUE(creator_.AddSavedFrame(frame)); | 923 EXPECT_TRUE(creator_.AddSavedFrame(frame)); |
930 EXPECT_TRUE(creator_.HasPendingFrames()); | 924 EXPECT_TRUE(creator_.HasPendingFrames()); |
931 | 925 |
932 QuicPaddingFrame padding_frame; | 926 QuicPaddingFrame padding_frame; |
933 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&padding_frame))); | 927 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&padding_frame))); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 // After 64 calls, BoolSource will refresh the bucket - make sure it does. | 1050 // After 64 calls, BoolSource will refresh the bucket - make sure it does. |
1057 mock_random_.ChangeValue(); | 1051 mock_random_.ChangeValue(); |
1058 } | 1052 } |
1059 | 1053 |
1060 delete frames_[0].stream_frame; | 1054 delete frames_[0].stream_frame; |
1061 } | 1055 } |
1062 | 1056 |
1063 } // namespace | 1057 } // namespace |
1064 } // namespace test | 1058 } // namespace test |
1065 } // namespace net | 1059 } // namespace net |
OLD | NEW |