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

Side by Side Diff: net/quic/core/quic_packet_generator_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 | « net/quic/core/quic_packet_creator_test.cc ('k') | net/quic/core/quic_utils.h » ('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_generator.h" 5 #include "net/quic/core/quic_packet_generator.h"
6 6
7 #include <cstdint> 7 #include <cstdint>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 QuicIOVector CreateData(size_t len) { 197 QuicIOVector CreateData(size_t len) {
198 data_array_.reset(new char[len]); 198 data_array_.reset(new char[len]);
199 memset(data_array_.get(), '?', len); 199 memset(data_array_.get(), '?', len);
200 iov_.iov_base = data_array_.get(); 200 iov_.iov_base = data_array_.get();
201 iov_.iov_len = len; 201 iov_.iov_len = len;
202 return QuicIOVector(&iov_, 1, len); 202 return QuicIOVector(&iov_, 1, len);
203 } 203 }
204 204
205 QuicIOVector MakeIOVector(StringPiece s) { 205 QuicIOVector MakeIOVector(StringPiece s) {
206 return ::net::MakeIOVector(s, &iov_); 206 return ::net::test::MakeIOVector(s, &iov_);
207 } 207 }
208 208
209 QuicFramer framer_; 209 QuicFramer framer_;
210 SimpleBufferAllocator buffer_allocator_; 210 SimpleBufferAllocator buffer_allocator_;
211 StrictMock<MockDelegate> delegate_; 211 StrictMock<MockDelegate> delegate_;
212 QuicPacketGenerator generator_; 212 QuicPacketGenerator generator_;
213 QuicPacketCreator* creator_; 213 QuicPacketCreator* creator_;
214 SimpleQuicFramer simple_framer_; 214 SimpleQuicFramer simple_framer_;
215 std::vector<SerializedPacket> packets_; 215 std::vector<SerializedPacket> packets_;
216 QuicAckFrame ack_frame_; 216 QuicAckFrame ack_frame_;
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 frame->error_details = error_details.as_string(); 884 frame->error_details = error_details.as_string();
885 EXPECT_CALL(delegate_, 885 EXPECT_CALL(delegate_,
886 OnUnrecoverableError(QUIC_FAILED_TO_SERIALIZE_PACKET, 886 OnUnrecoverableError(QUIC_FAILED_TO_SERIALIZE_PACKET,
887 "Single frame cannot fit into a packet", _)); 887 "Single frame cannot fit into a packet", _));
888 EXPECT_QUIC_BUG(generator_.AddControlFrame(QuicFrame(frame)), ""); 888 EXPECT_QUIC_BUG(generator_.AddControlFrame(QuicFrame(frame)), "");
889 EXPECT_TRUE(generator_.HasQueuedFrames()); 889 EXPECT_TRUE(generator_.HasQueuedFrames());
890 } 890 }
891 891
892 } // namespace test 892 } // namespace test
893 } // namespace net 893 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_packet_creator_test.cc ('k') | net/quic/core/quic_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698