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

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

Issue 559373003: Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compiler errors Created 6 years, 3 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
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/end_to_end_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/test_tools/quic_test_utils.h" 5 #include "net/quic/test_tools/quic_test_utils.h"
6 6
7 #include "base/sha1.h" 7 #include "base/sha1.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "net/quic/crypto/crypto_framer.h" 10 #include "net/quic/crypto/crypto_framer.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 bool is_server, 295 bool is_server,
296 const QuicVersionVector& supported_versions) 296 const QuicVersionVector& supported_versions)
297 : MockConnection(is_server, supported_versions) { 297 : MockConnection(is_server, supported_versions) {
298 } 298 }
299 299
300 PacketSavingConnection::~PacketSavingConnection() { 300 PacketSavingConnection::~PacketSavingConnection() {
301 STLDeleteElements(&packets_); 301 STLDeleteElements(&packets_);
302 STLDeleteElements(&encrypted_packets_); 302 STLDeleteElements(&encrypted_packets_);
303 } 303 }
304 304
305 bool PacketSavingConnection::SendOrQueuePacket( 305 void PacketSavingConnection::SendOrQueuePacket(QueuedPacket packet) {
306 EncryptionLevel level, 306 packets_.push_back(packet.serialized_packet.packet);
307 const SerializedPacket& packet,
308 TransmissionType transmission_type) {
309 packets_.push_back(packet.packet);
310 QuicEncryptedPacket* encrypted = QuicConnectionPeer::GetFramer(this)-> 307 QuicEncryptedPacket* encrypted = QuicConnectionPeer::GetFramer(this)->
311 EncryptPacket(level, packet.sequence_number, *packet.packet); 308 EncryptPacket(packet.encryption_level,
309 packet.serialized_packet.sequence_number,
310 *packet.serialized_packet.packet);
312 encrypted_packets_.push_back(encrypted); 311 encrypted_packets_.push_back(encrypted);
313 return true; 312 // Transfer ownership of the packet to the SentPacketManager and the
313 // ack notifier to the AckNotifierManager.
314 sent_packet_manager_.OnSerializedPacket(packet.serialized_packet);
314 } 315 }
315 316
316 MockSession::MockSession(QuicConnection* connection) 317 MockSession::MockSession(QuicConnection* connection)
317 : QuicSession(connection, DefaultQuicConfig()) { 318 : QuicSession(connection, DefaultQuicConfig()) {
318 InitializeSession(); 319 InitializeSession();
319 ON_CALL(*this, WritevData(_, _, _, _, _, _)) 320 ON_CALL(*this, WritevData(_, _, _, _, _, _))
320 .WillByDefault(testing::Return(QuicConsumedData(0, false))); 321 .WillByDefault(testing::Return(QuicConsumedData(0, false)));
321 } 322 }
322 323
323 MockSession::~MockSession() { 324 MockSession::~MockSession() {
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 // different way, so TestWriterFactory::OnPacketSent might never be called. 667 // different way, so TestWriterFactory::OnPacketSent might never be called.
667 factory_->current_writer_ = this; 668 factory_->current_writer_ = this;
668 return QuicPerConnectionPacketWriter::WritePacket(buffer, 669 return QuicPerConnectionPacketWriter::WritePacket(buffer,
669 buf_len, 670 buf_len,
670 self_address, 671 self_address,
671 peer_address); 672 peer_address);
672 } 673 }
673 674
674 } // namespace test 675 } // namespace test
675 } // namespace net 676 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698