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

Side by Side Diff: net/quic/core/quic_packet_creator_test.cc

Issue 2517673002: Move test only MakeIOVector method to test_tools/quic_test_utils.h. No behavior change. (Closed)
Patch Set: Created 4 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 | « no previous file | net/quic/core/quic_packet_generator_test.cc » ('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/core/quic_packet_creator.h" 5 #include "net/quic/core/quic_packet_creator.h"
6 6
7 #include <cstdint> 7 #include <cstdint>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 186 }
187 187
188 // Returns the number of bytes consumed by the non-data fields of a stream 188 // Returns the number of bytes consumed by the non-data fields of a stream
189 // frame, assuming it is the last frame in the packet 189 // frame, assuming it is the last frame in the packet
190 size_t GetStreamFrameOverhead() { 190 size_t GetStreamFrameOverhead() {
191 return QuicFramer::GetMinStreamFrameSize(kClientDataStreamId1, kOffset, 191 return QuicFramer::GetMinStreamFrameSize(kClientDataStreamId1, kOffset,
192 true); 192 true);
193 } 193 }
194 194
195 QuicIOVector MakeIOVector(StringPiece s) { 195 QuicIOVector MakeIOVector(StringPiece s) {
196 return ::net::MakeIOVector(s, &iov_); 196 return ::net::test::MakeIOVector(s, &iov_);
197 } 197 }
198 198
199 PendingRetransmission CreateRetransmission( 199 PendingRetransmission CreateRetransmission(
200 const QuicFrames& retransmittable_frames, 200 const QuicFrames& retransmittable_frames,
201 bool has_crypto_handshake, 201 bool has_crypto_handshake,
202 int num_padding_bytes, 202 int num_padding_bytes,
203 EncryptionLevel encryption_level, 203 EncryptionLevel encryption_level,
204 QuicPacketNumberLength packet_number_length) { 204 QuicPacketNumberLength packet_number_length) {
205 return PendingRetransmission(1u, 1u, NOT_RETRANSMISSION, 205 return PendingRetransmission(1u, 1u, NOT_RETRANSMISSION,
206 retransmittable_frames, has_crypto_handshake, 206 retransmittable_frames, has_crypto_handshake,
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 936
937 TEST_P(QuicPacketCreatorTest, ChloTooLarge) { 937 TEST_P(QuicPacketCreatorTest, ChloTooLarge) {
938 CryptoHandshakeMessage message; 938 CryptoHandshakeMessage message;
939 message.set_tag(kCHLO); 939 message.set_tag(kCHLO);
940 message.set_minimum_size(kMaxPacketSize); 940 message.set_minimum_size(kMaxPacketSize);
941 CryptoFramer framer; 941 CryptoFramer framer;
942 std::unique_ptr<QuicData> message_data; 942 std::unique_ptr<QuicData> message_data;
943 message_data.reset(framer.ConstructHandshakeMessage(message)); 943 message_data.reset(framer.ConstructHandshakeMessage(message));
944 944
945 struct iovec iov; 945 struct iovec iov;
946 QuicIOVector data_iovec(::net::MakeIOVector( 946 QuicIOVector data_iovec(::net::test::MakeIOVector(
947 StringPiece(message_data->data(), message_data->length()), &iov)); 947 StringPiece(message_data->data(), message_data->length()), &iov));
948 QuicFrame frame; 948 QuicFrame frame;
949 EXPECT_CALL(delegate_, 949 EXPECT_CALL(delegate_,
950 OnUnrecoverableError(QUIC_CRYPTO_CHLO_TOO_LARGE, _, _)); 950 OnUnrecoverableError(QUIC_CRYPTO_CHLO_TOO_LARGE, _, _));
951 EXPECT_QUIC_BUG(creator_.ConsumeData(kCryptoStreamId, data_iovec, 0u, 0u, 951 EXPECT_QUIC_BUG(creator_.ConsumeData(kCryptoStreamId, data_iovec, 0u, 0u,
952 false, false, &frame), 952 false, false, &frame),
953 "Client hello won't fit in a single packet."); 953 "Client hello won't fit in a single packet.");
954 } 954 }
955 955
956 } // namespace 956 } // namespace
957 } // namespace test 957 } // namespace test
958 } // namespace net 958 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/core/quic_packet_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698