| 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 325 |
| 326 PacketSavingConnection::~PacketSavingConnection() { | 326 PacketSavingConnection::~PacketSavingConnection() { |
| 327 STLDeleteElements(&encrypted_packets_); | 327 STLDeleteElements(&encrypted_packets_); |
| 328 } | 328 } |
| 329 | 329 |
| 330 void PacketSavingConnection::SendOrQueuePacket(SerializedPacket* packet) { | 330 void PacketSavingConnection::SendOrQueuePacket(SerializedPacket* packet) { |
| 331 encrypted_packets_.push_back(new QuicEncryptedPacket( | 331 encrypted_packets_.push_back(new QuicEncryptedPacket( |
| 332 QuicUtils::CopyBuffer(*packet), packet->encrypted_length, true)); | 332 QuicUtils::CopyBuffer(*packet), packet->encrypted_length, true)); |
| 333 // Transfer ownership of the packet to the SentPacketManager and the | 333 // Transfer ownership of the packet to the SentPacketManager and the |
| 334 // ack notifier to the AckNotifierManager. | 334 // ack notifier to the AckNotifierManager. |
| 335 sent_packet_manager_.OnPacketSent(packet, 0, QuicTime::Zero(), | 335 sent_packet_manager_.OnPacketSent(packet, kInvalidPathId, 0, QuicTime::Zero(), |
| 336 NOT_RETRANSMISSION, | 336 NOT_RETRANSMISSION, |
| 337 HAS_RETRANSMITTABLE_DATA); | 337 HAS_RETRANSMITTABLE_DATA); |
| 338 } | 338 } |
| 339 | 339 |
| 340 MockQuicSession::MockQuicSession(QuicConnection* connection) | 340 MockQuicSession::MockQuicSession(QuicConnection* connection) |
| 341 : QuicSession(connection, DefaultQuicConfig()) { | 341 : QuicSession(connection, DefaultQuicConfig()) { |
| 342 crypto_stream_.reset(new QuicCryptoStream(this)); | 342 crypto_stream_.reset(new QuicCryptoStream(this)); |
| 343 Initialize(); | 343 Initialize(); |
| 344 ON_CALL(*this, WritevData(_, _, _, _, _)) | 344 ON_CALL(*this, WritevData(_, _, _, _, _)) |
| 345 .WillByDefault(testing::Return(QuicConsumedData(0, false))); | 345 .WillByDefault(testing::Return(QuicConsumedData(0, false))); |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 // strike register worries that we've just overflowed a uint32_t time. | 878 // strike register worries that we've just overflowed a uint32_t time. |
| 879 (*server_connection)->AdvanceTime(connection_start_time); | 879 (*server_connection)->AdvanceTime(connection_start_time); |
| 880 } | 880 } |
| 881 | 881 |
| 882 QuicStreamId QuicClientDataStreamId(int i) { | 882 QuicStreamId QuicClientDataStreamId(int i) { |
| 883 return kClientDataStreamId1 + 2 * i; | 883 return kClientDataStreamId1 + 2 * i; |
| 884 } | 884 } |
| 885 | 885 |
| 886 } // namespace test | 886 } // namespace test |
| 887 } // namespace net | 887 } // namespace net |
| OLD | NEW |