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_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 Loading... |
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 |
OLD | NEW |