| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "net/quic/crypto/null_encrypter.h" | 10 #include "net/quic/crypto/null_encrypter.h" |
| (...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 QuicIOVector io_vector(MakeIOVector("test")); | 999 QuicIOVector io_vector(MakeIOVector("test")); |
| 1000 UniqueStreamBuffer stream_buffer; | 1000 UniqueStreamBuffer stream_buffer; |
| 1001 size_t consumed = creator_.CreateStreamFrame(1u, io_vector, 0u, 0u, false, | 1001 size_t consumed = creator_.CreateStreamFrame(1u, io_vector, 0u, 0u, false, |
| 1002 &frame, &stream_buffer); | 1002 &frame, &stream_buffer); |
| 1003 EXPECT_EQ(4u, consumed); | 1003 EXPECT_EQ(4u, consumed); |
| 1004 ASSERT_TRUE(frame.stream_frame); | 1004 ASSERT_TRUE(frame.stream_frame); |
| 1005 EXPECT_TRUE(creator_.AddSavedFrame(frame)); | 1005 EXPECT_TRUE(creator_.AddSavedFrame(frame)); |
| 1006 EXPECT_TRUE(creator_.HasPendingFrames()); | 1006 EXPECT_TRUE(creator_.HasPendingFrames()); |
| 1007 | 1007 |
| 1008 QuicPaddingFrame padding_frame; | 1008 QuicPaddingFrame padding_frame; |
| 1009 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(&padding_frame))); | 1009 EXPECT_TRUE(creator_.AddSavedFrame(QuicFrame(padding_frame))); |
| 1010 EXPECT_TRUE(creator_.HasPendingFrames()); | 1010 EXPECT_TRUE(creator_.HasPendingFrames()); |
| 1011 EXPECT_EQ(0u, creator_.BytesFree()); | 1011 EXPECT_EQ(0u, creator_.BytesFree()); |
| 1012 | 1012 |
| 1013 EXPECT_FALSE(creator_.AddSavedFrame(QuicFrame(&ack_frame))); | 1013 EXPECT_FALSE(creator_.AddSavedFrame(QuicFrame(&ack_frame))); |
| 1014 | 1014 |
| 1015 // Ensure the packet is successfully created. | 1015 // Ensure the packet is successfully created. |
| 1016 char buffer[kMaxPacketSize]; | 1016 char buffer[kMaxPacketSize]; |
| 1017 SerializedPacket serialized = | 1017 SerializedPacket serialized = |
| 1018 creator_.SerializePacket(buffer, kMaxPacketSize); | 1018 creator_.SerializePacket(buffer, kMaxPacketSize); |
| 1019 ASSERT_TRUE(serialized.packet); | 1019 ASSERT_TRUE(serialized.packet); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1223 EXPECT_FALSE(creator_.HasPendingFrames()); | 1223 EXPECT_FALSE(creator_.HasPendingFrames()); |
| 1224 | 1224 |
| 1225 // Close the FEC Group. | 1225 // Close the FEC Group. |
| 1226 creator_.ResetFecGroup(); | 1226 creator_.ResetFecGroup(); |
| 1227 EXPECT_FALSE(creator_.IsFecGroupOpen()); | 1227 EXPECT_FALSE(creator_.IsFecGroupOpen()); |
| 1228 } | 1228 } |
| 1229 | 1229 |
| 1230 } // namespace | 1230 } // namespace |
| 1231 } // namespace test | 1231 } // namespace test |
| 1232 } // namespace net | 1232 } // namespace net |
| OLD | NEW |