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 2959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2970 ASSERT_EQ(QUIC_NO_ERROR, framer_.error()); | 2970 ASSERT_EQ(QUIC_NO_ERROR, framer_.error()); |
2971 ASSERT_TRUE(visitor_.public_reset_packet_.get()); | 2971 ASSERT_TRUE(visitor_.public_reset_packet_.get()); |
2972 EXPECT_EQ(kConnectionId, | 2972 EXPECT_EQ(kConnectionId, |
2973 visitor_.public_reset_packet_->public_header.connection_id); | 2973 visitor_.public_reset_packet_->public_header.connection_id); |
2974 EXPECT_TRUE(visitor_.public_reset_packet_->public_header.reset_flag); | 2974 EXPECT_TRUE(visitor_.public_reset_packet_->public_header.reset_flag); |
2975 EXPECT_FALSE(visitor_.public_reset_packet_->public_header.version_flag); | 2975 EXPECT_FALSE(visitor_.public_reset_packet_->public_header.version_flag); |
2976 EXPECT_EQ(kNonceProof, visitor_.public_reset_packet_->nonce_proof); | 2976 EXPECT_EQ(kNonceProof, visitor_.public_reset_packet_->nonce_proof); |
2977 EXPECT_EQ(kPacketNumber, | 2977 EXPECT_EQ(kPacketNumber, |
2978 visitor_.public_reset_packet_->rejected_packet_number); | 2978 visitor_.public_reset_packet_->rejected_packet_number); |
2979 EXPECT_EQ("4.31.198.44", | 2979 EXPECT_EQ("4.31.198.44", |
2980 IPAddressToString( | 2980 visitor_.public_reset_packet_->client_address.address().ToString()); |
2981 visitor_.public_reset_packet_->client_address.address())); | |
2982 EXPECT_EQ(443, visitor_.public_reset_packet_->client_address.port()); | 2981 EXPECT_EQ(443, visitor_.public_reset_packet_->client_address.port()); |
2983 | 2982 |
2984 // Now test framing boundaries. | 2983 // Now test framing boundaries. |
2985 for (size_t i = 0; i < arraysize(packet); ++i) { | 2984 for (size_t i = 0; i < arraysize(packet); ++i) { |
2986 string expected_error; | 2985 string expected_error; |
2987 DVLOG(1) << "iteration: " << i; | 2986 DVLOG(1) << "iteration: " << i; |
2988 if (i < kConnectionIdOffset) { | 2987 if (i < kConnectionIdOffset) { |
2989 expected_error = "Unable to read public flags."; | 2988 expected_error = "Unable to read public flags."; |
2990 CheckProcessingFails(packet, i, expected_error, | 2989 CheckProcessingFails(packet, i, expected_error, |
2991 QUIC_INVALID_PACKET_HEADER); | 2990 QUIC_INVALID_PACKET_HEADER); |
(...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4777 'o', ' ', 'w', 'o', | 4776 'o', ' ', 'w', 'o', |
4778 'r', 'l', 'd', '!', | 4777 'r', 'l', 'd', '!', |
4779 }; | 4778 }; |
4780 // clang-format on | 4779 // clang-format on |
4781 | 4780 |
4782 QuicFramerFuzzFunc(packet, arraysize(packet)); | 4781 QuicFramerFuzzFunc(packet, arraysize(packet)); |
4783 } | 4782 } |
4784 | 4783 |
4785 } // namespace test | 4784 } // namespace test |
4786 } // namespace net | 4785 } // namespace net |
OLD | NEW |