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

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

Issue 1565303002: Change IPEndpoint::address() to return a net::IPAddress (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback eroman Created 4 years, 11 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
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_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 2958 matching lines...) Expand 10 before | Expand all | Expand 10 after
2969 EXPECT_TRUE(framer_.ProcessPacket(encrypted)); 2969 EXPECT_TRUE(framer_.ProcessPacket(encrypted));
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(
2980 IPAddressToString( 2980 "4.31.198.44",
2981 visitor_.public_reset_packet_->client_address.address())); 2981 IPAddressToString(
2982 visitor_.public_reset_packet_->client_address.address().bytes()));
eroman 2016/01/13 23:19:42 Can probably do address().ToString() instead of IP
martijnc 2016/01/14 22:48:17 Done.
2982 EXPECT_EQ(443, visitor_.public_reset_packet_->client_address.port()); 2983 EXPECT_EQ(443, visitor_.public_reset_packet_->client_address.port());
2983 2984
2984 // Now test framing boundaries. 2985 // Now test framing boundaries.
2985 for (size_t i = 0; i < arraysize(packet); ++i) { 2986 for (size_t i = 0; i < arraysize(packet); ++i) {
2986 string expected_error; 2987 string expected_error;
2987 DVLOG(1) << "iteration: " << i; 2988 DVLOG(1) << "iteration: " << i;
2988 if (i < kConnectionIdOffset) { 2989 if (i < kConnectionIdOffset) {
2989 expected_error = "Unable to read public flags."; 2990 expected_error = "Unable to read public flags.";
2990 CheckProcessingFails(packet, i, expected_error, 2991 CheckProcessingFails(packet, i, expected_error,
2991 QUIC_INVALID_PACKET_HEADER); 2992 QUIC_INVALID_PACKET_HEADER);
(...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after
4777 'o', ' ', 'w', 'o', 4778 'o', ' ', 'w', 'o',
4778 'r', 'l', 'd', '!', 4779 'r', 'l', 'd', '!',
4779 }; 4780 };
4780 // clang-format on 4781 // clang-format on
4781 4782
4782 QuicFramerFuzzFunc(packet, arraysize(packet)); 4783 QuicFramerFuzzFunc(packet, arraysize(packet));
4783 } 4784 }
4784 4785
4785 } // namespace test 4786 } // namespace test
4786 } // namespace net 4787 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698