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_framer.h" | 5 #include "net/quic/quic_framer.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 3015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3026 ASSERT_EQ(QUIC_NO_ERROR, framer_.error()); | 3026 ASSERT_EQ(QUIC_NO_ERROR, framer_.error()); |
3027 ASSERT_TRUE(visitor_.public_reset_packet_.get()); | 3027 ASSERT_TRUE(visitor_.public_reset_packet_.get()); |
3028 EXPECT_EQ(kConnectionId, | 3028 EXPECT_EQ(kConnectionId, |
3029 visitor_.public_reset_packet_->public_header.connection_id); | 3029 visitor_.public_reset_packet_->public_header.connection_id); |
3030 EXPECT_TRUE(visitor_.public_reset_packet_->public_header.reset_flag); | 3030 EXPECT_TRUE(visitor_.public_reset_packet_->public_header.reset_flag); |
3031 EXPECT_FALSE(visitor_.public_reset_packet_->public_header.version_flag); | 3031 EXPECT_FALSE(visitor_.public_reset_packet_->public_header.version_flag); |
3032 EXPECT_EQ(kNonceProof, visitor_.public_reset_packet_->nonce_proof); | 3032 EXPECT_EQ(kNonceProof, visitor_.public_reset_packet_->nonce_proof); |
3033 EXPECT_EQ(kPacketNumber, | 3033 EXPECT_EQ(kPacketNumber, |
3034 visitor_.public_reset_packet_->rejected_packet_number); | 3034 visitor_.public_reset_packet_->rejected_packet_number); |
3035 EXPECT_EQ("4.31.198.44", | 3035 EXPECT_EQ("4.31.198.44", |
3036 IPAddressToString( | 3036 visitor_.public_reset_packet_->client_address.address().ToString()); |
3037 visitor_.public_reset_packet_->client_address.address())); | |
3038 EXPECT_EQ(443, visitor_.public_reset_packet_->client_address.port()); | 3037 EXPECT_EQ(443, visitor_.public_reset_packet_->client_address.port()); |
3039 | 3038 |
3040 // Now test framing boundaries. | 3039 // Now test framing boundaries. |
3041 for (size_t i = 0; i < arraysize(packet); ++i) { | 3040 for (size_t i = 0; i < arraysize(packet); ++i) { |
3042 string expected_error; | 3041 string expected_error; |
3043 DVLOG(1) << "iteration: " << i; | 3042 DVLOG(1) << "iteration: " << i; |
3044 if (i < kConnectionIdOffset) { | 3043 if (i < kConnectionIdOffset) { |
3045 expected_error = "Unable to read public flags."; | 3044 expected_error = "Unable to read public flags."; |
3046 CheckProcessingFails(packet, i, expected_error, | 3045 CheckProcessingFails(packet, i, expected_error, |
3047 QUIC_INVALID_PACKET_HEADER); | 3046 QUIC_INVALID_PACKET_HEADER); |
(...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4956 'o', ' ', 'w', 'o', | 4955 'o', ' ', 'w', 'o', |
4957 'r', 'l', 'd', '!', | 4956 'r', 'l', 'd', '!', |
4958 }; | 4957 }; |
4959 // clang-format on | 4958 // clang-format on |
4960 | 4959 |
4961 QuicFramerFuzzFunc(packet, arraysize(packet)); | 4960 QuicFramerFuzzFunc(packet, arraysize(packet)); |
4962 } | 4961 } |
4963 | 4962 |
4964 } // namespace test | 4963 } // namespace test |
4965 } // namespace net | 4964 } // namespace net |
OLD | NEW |