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

Side by Side Diff: net/quic/test_tools/quic_test_utils.cc

Issue 14718011: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/quic/test_tools/simple_quic_framer.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/test_tools/quic_test_utils.h" 5 #include "net/quic/test_tools/quic_test_utils.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "net/quic/crypto/crypto_framer.h" 8 #include "net/quic/crypto/crypto_framer.h"
9 #include "net/quic/crypto/crypto_handshake.h" 9 #include "net/quic/crypto/crypto_handshake.h"
10 #include "net/quic/crypto/crypto_utils.h" 10 #include "net/quic/crypto/crypto_utils.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 IPEndPoint address, 211 IPEndPoint address,
212 bool is_server) 212 bool is_server)
213 : MockConnection(guid, address, is_server) { 213 : MockConnection(guid, address, is_server) {
214 } 214 }
215 215
216 PacketSavingConnection::~PacketSavingConnection() { 216 PacketSavingConnection::~PacketSavingConnection() {
217 STLDeleteElements(&packets_); 217 STLDeleteElements(&packets_);
218 } 218 }
219 219
220 bool PacketSavingConnection::SendOrQueuePacket( 220 bool PacketSavingConnection::SendOrQueuePacket(
221 EncryptionLevel level,
221 QuicPacketSequenceNumber sequence_number, 222 QuicPacketSequenceNumber sequence_number,
222 QuicPacket* packet, 223 QuicPacket* packet,
223 QuicPacketEntropyHash entropy_hash, 224 QuicPacketEntropyHash entropy_hash,
224 HasRetransmittableData retransmittable) { 225 HasRetransmittableData retransmittable) {
225 packets_.push_back(packet); 226 packets_.push_back(packet);
226 return true; 227 return true;
227 } 228 }
228 229
229 MockSession::MockSession(QuicConnection* connection, bool is_server) 230 MockSession::MockSession(QuicConnection* connection, bool is_server)
230 : QuicSession(connection, is_server) { 231 : QuicSession(connection, is_server) {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 actual->data(), actual->length(), 323 actual->data(), actual->length(),
323 expected->data(), expected->length()); 324 expected->data(), expected->length());
324 } 325 }
325 326
326 static QuicPacket* ConstructPacketFromHandshakeMessage( 327 static QuicPacket* ConstructPacketFromHandshakeMessage(
327 QuicGuid guid, 328 QuicGuid guid,
328 const CryptoHandshakeMessage& message, 329 const CryptoHandshakeMessage& message,
329 bool should_include_version) { 330 bool should_include_version) {
330 CryptoFramer crypto_framer; 331 CryptoFramer crypto_framer;
331 scoped_ptr<QuicData> data(crypto_framer.ConstructHandshakeMessage(message)); 332 scoped_ptr<QuicData> data(crypto_framer.ConstructHandshakeMessage(message));
332 QuicFramer quic_framer(kQuicVersion1, 333 QuicFramer quic_framer(kQuicVersion1, QuicTime::Zero(), false);
333 QuicDecrypter::Create(kNULL),
334 QuicEncrypter::Create(kNULL),
335 QuicTime::Zero(),
336 false);
337 334
338 QuicPacketHeader header; 335 QuicPacketHeader header;
339 header.public_header.guid = guid; 336 header.public_header.guid = guid;
340 header.public_header.reset_flag = false; 337 header.public_header.reset_flag = false;
341 header.public_header.version_flag = should_include_version; 338 header.public_header.version_flag = should_include_version;
342 header.packet_sequence_number = 1; 339 header.packet_sequence_number = 1;
343 header.entropy_flag = false; 340 header.entropy_flag = false;
344 header.entropy_hash = 0; 341 header.entropy_hash = 0;
345 header.fec_flag = false; 342 header.fec_flag = false;
346 header.fec_entropy_flag = false; 343 header.fec_entropy_flag = false;
(...skipping 27 matching lines...) Expand all
374 return packet_length; 371 return packet_length;
375 } 372 }
376 373
377 QuicPacketEntropyHash TestEntropyCalculator::ReceivedEntropyHash( 374 QuicPacketEntropyHash TestEntropyCalculator::ReceivedEntropyHash(
378 QuicPacketSequenceNumber sequence_number) const { 375 QuicPacketSequenceNumber sequence_number) const {
379 return 1u; 376 return 1u;
380 } 377 }
381 378
382 } // namespace test 379 } // namespace test
383 } // namespace net 380 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/quic/test_tools/simple_quic_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698