| OLD | NEW |
| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/sha1.h" | 9 #include "base/sha1.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 330 |
| 331 PacketSavingConnection::~PacketSavingConnection() { | 331 PacketSavingConnection::~PacketSavingConnection() { |
| 332 STLDeleteElements(&encrypted_packets_); | 332 STLDeleteElements(&encrypted_packets_); |
| 333 } | 333 } |
| 334 | 334 |
| 335 void PacketSavingConnection::SendOrQueuePacket(SerializedPacket* packet) { | 335 void PacketSavingConnection::SendOrQueuePacket(SerializedPacket* packet) { |
| 336 encrypted_packets_.push_back(new QuicEncryptedPacket( | 336 encrypted_packets_.push_back(new QuicEncryptedPacket( |
| 337 QuicUtils::CopyBuffer(*packet), packet->encrypted_length, true)); | 337 QuicUtils::CopyBuffer(*packet), packet->encrypted_length, true)); |
| 338 // Transfer ownership of the packet to the SentPacketManager and the | 338 // Transfer ownership of the packet to the SentPacketManager and the |
| 339 // ack notifier to the AckNotifierManager. | 339 // ack notifier to the AckNotifierManager. |
| 340 sent_packet_manager_.OnPacketSent(packet, kInvalidPathId, 0, QuicTime::Zero(), | 340 sent_packet_manager_->OnPacketSent(packet, kInvalidPathId, 0, |
| 341 NOT_RETRANSMISSION, | 341 QuicTime::Zero(), NOT_RETRANSMISSION, |
| 342 HAS_RETRANSMITTABLE_DATA); | 342 HAS_RETRANSMITTABLE_DATA); |
| 343 } | 343 } |
| 344 | 344 |
| 345 MockQuicSession::MockQuicSession(QuicConnection* connection) | 345 MockQuicSession::MockQuicSession(QuicConnection* connection) |
| 346 : QuicSession(connection, DefaultQuicConfig()) { | 346 : QuicSession(connection, DefaultQuicConfig()) { |
| 347 crypto_stream_.reset(new QuicCryptoStream(this)); | 347 crypto_stream_.reset(new QuicCryptoStream(this)); |
| 348 Initialize(); | 348 Initialize(); |
| 349 ON_CALL(*this, WritevData(_, _, _, _, _, _)) | 349 ON_CALL(*this, WritevData(_, _, _, _, _, _)) |
| 350 .WillByDefault(testing::Return(QuicConsumedData(0, false))); | 350 .WillByDefault(testing::Return(QuicConsumedData(0, false))); |
| 351 } | 351 } |
| 352 | 352 |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 // strike register worries that we've just overflowed a uint32_t time. | 884 // strike register worries that we've just overflowed a uint32_t time. |
| 885 (*server_connection)->AdvanceTime(connection_start_time); | 885 (*server_connection)->AdvanceTime(connection_start_time); |
| 886 } | 886 } |
| 887 | 887 |
| 888 QuicStreamId QuicClientDataStreamId(int i) { | 888 QuicStreamId QuicClientDataStreamId(int i) { |
| 889 return kClientDataStreamId1 + 2 * i; | 889 return kClientDataStreamId1 + 2 * i; |
| 890 } | 890 } |
| 891 | 891 |
| 892 } // namespace test | 892 } // namespace test |
| 893 } // namespace net | 893 } // namespace net |
| OLD | NEW |