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

Side by Side Diff: net/quic/quic_packet_creator_test.cc

Issue 1399893005: relnote: Inline all frames smaller than a pointer into QuicFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Avoid_redundant_recvmmsg_104327020
Patch Set: Created 5 years, 2 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
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/quic_packet_generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/quic_packet_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698