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

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

Issue 687033002: Adding an option for peers to negotiate the length of the QUIC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_1028
Patch Set: Created 6 years, 1 month 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_generator.cc ('k') | net/quic/test_tools/quic_config_peer.h » ('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_generator.h" 5 #include "net/quic/quic_packet_generator.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "net/quic/crypto/crypto_protocol.h" 9 #include "net/quic/crypto/crypto_protocol.h"
10 #include "net/quic/crypto/null_encrypter.h" 10 #include "net/quic/crypto/null_encrypter.h"
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 contents.num_stream_frames = 1; 946 contents.num_stream_frames = 1;
947 CheckPacketContains(contents, packet_); 947 CheckPacketContains(contents, packet_);
948 948
949 // The second should have the remainder of the stream data. 949 // The second should have the remainder of the stream data.
950 PacketContents contents2; 950 PacketContents contents2;
951 contents2.num_goaway_frames = 1; 951 contents2.num_goaway_frames = 1;
952 contents2.num_stream_frames = 1; 952 contents2.num_stream_frames = 1;
953 CheckPacketContains(contents2, packet2_); 953 CheckPacketContains(contents2, packet2_);
954 } 954 }
955 955
956 TEST_F(QuicPacketGeneratorTest, TestConnectionIdLength) {
957 generator_.SetConnectionIdLength(0);
958 EXPECT_EQ(PACKET_0BYTE_CONNECTION_ID, creator_->connection_id_length());
959 generator_.SetConnectionIdLength(1);
960 EXPECT_EQ(PACKET_1BYTE_CONNECTION_ID, creator_->connection_id_length());
961 generator_.SetConnectionIdLength(2);
962 EXPECT_EQ(PACKET_4BYTE_CONNECTION_ID, creator_->connection_id_length());
963 generator_.SetConnectionIdLength(3);
964 EXPECT_EQ(PACKET_4BYTE_CONNECTION_ID, creator_->connection_id_length());
965 generator_.SetConnectionIdLength(4);
966 EXPECT_EQ(PACKET_4BYTE_CONNECTION_ID, creator_->connection_id_length());
967 generator_.SetConnectionIdLength(5);
968 EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length());
969 generator_.SetConnectionIdLength(6);
970 EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length());
971 generator_.SetConnectionIdLength(7);
972 EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length());
973 generator_.SetConnectionIdLength(8);
974 EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length());
975 generator_.SetConnectionIdLength(9);
976 EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length());
977 }
978
956 } // namespace test 979 } // namespace test
957 } // namespace net 980 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_packet_generator.cc ('k') | net/quic/test_tools/quic_config_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698