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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, QuicTime::Zero(), |
341 NOT_RETRANSMISSION, | 341 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 |
353 MockQuicSession::~MockQuicSession() {} | 353 MockQuicSession::~MockQuicSession() {} |
354 | 354 |
355 // static | 355 // static |
356 QuicConsumedData MockQuicSession::ConsumeAllData( | 356 QuicConsumedData MockQuicSession::ConsumeAllData( |
| 357 ReliableQuicStream* /*stream*/, |
357 QuicStreamId /*id*/, | 358 QuicStreamId /*id*/, |
358 const QuicIOVector& data, | 359 const QuicIOVector& data, |
359 QuicStreamOffset /*offset*/, | 360 QuicStreamOffset /*offset*/, |
360 bool fin, | 361 bool fin, |
361 QuicAckListenerInterface* /*ack_notifier_delegate*/) { | 362 QuicAckListenerInterface* /*ack_notifier_delegate*/) { |
362 return QuicConsumedData(data.total_length, fin); | 363 return QuicConsumedData(data.total_length, fin); |
363 } | 364 } |
364 | 365 |
365 MockQuicSpdySession::MockQuicSpdySession(QuicConnection* connection) | 366 MockQuicSpdySession::MockQuicSpdySession(QuicConnection* connection) |
366 : QuicSpdySession(connection, DefaultQuicConfig()) { | 367 : QuicSpdySession(connection, DefaultQuicConfig()) { |
367 crypto_stream_.reset(new QuicCryptoStream(this)); | 368 crypto_stream_.reset(new QuicCryptoStream(this)); |
368 Initialize(); | 369 Initialize(); |
369 ON_CALL(*this, WritevData(_, _, _, _, _)) | 370 ON_CALL(*this, WritevData(_, _, _, _, _, _)) |
370 .WillByDefault(testing::Return(QuicConsumedData(0, false))); | 371 .WillByDefault(testing::Return(QuicConsumedData(0, false))); |
371 } | 372 } |
372 | 373 |
373 MockQuicSpdySession::~MockQuicSpdySession() {} | 374 MockQuicSpdySession::~MockQuicSpdySession() {} |
374 | 375 |
375 TestQuicSpdyServerSession::TestQuicSpdyServerSession( | 376 TestQuicSpdyServerSession::TestQuicSpdyServerSession( |
376 QuicConnection* connection, | 377 QuicConnection* connection, |
377 const QuicConfig& config, | 378 const QuicConfig& config, |
378 const QuicCryptoServerConfig* crypto_config, | 379 const QuicCryptoServerConfig* crypto_config, |
379 QuicCompressedCertsCache* compressed_certs_cache) | 380 QuicCompressedCertsCache* compressed_certs_cache) |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 // 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. |
884 (*server_connection)->AdvanceTime(connection_start_time); | 885 (*server_connection)->AdvanceTime(connection_start_time); |
885 } | 886 } |
886 | 887 |
887 QuicStreamId QuicClientDataStreamId(int i) { | 888 QuicStreamId QuicClientDataStreamId(int i) { |
888 return kClientDataStreamId1 + 2 * i; | 889 return kClientDataStreamId1 + 2 * i; |
889 } | 890 } |
890 | 891 |
891 } // namespace test | 892 } // namespace test |
892 } // namespace net | 893 } // namespace net |
OLD | NEW |