| 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 "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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // ack notifier to the AckNotifierManager. | 302 // ack notifier to the AckNotifierManager. |
| 303 sent_packet_manager_.OnPacketSent(packet, 0, QuicTime::Zero(), | 303 sent_packet_manager_.OnPacketSent(packet, 0, QuicTime::Zero(), |
| 304 NOT_RETRANSMISSION, | 304 NOT_RETRANSMISSION, |
| 305 HAS_RETRANSMITTABLE_DATA); | 305 HAS_RETRANSMITTABLE_DATA); |
| 306 } | 306 } |
| 307 | 307 |
| 308 MockQuicSpdySession::MockQuicSpdySession(QuicConnection* connection) | 308 MockQuicSpdySession::MockQuicSpdySession(QuicConnection* connection) |
| 309 : QuicSpdySession(connection, DefaultQuicConfig()) { | 309 : QuicSpdySession(connection, DefaultQuicConfig()) { |
| 310 crypto_stream_.reset(new QuicCryptoStream(this)); | 310 crypto_stream_.reset(new QuicCryptoStream(this)); |
| 311 Initialize(); | 311 Initialize(); |
| 312 ON_CALL(*this, WritevData(_, _, _, _, _, _)) | 312 ON_CALL(*this, WritevData(_, _, _, _, _)) |
| 313 .WillByDefault(testing::Return(QuicConsumedData(0, false))); | 313 .WillByDefault(testing::Return(QuicConsumedData(0, false))); |
| 314 } | 314 } |
| 315 | 315 |
| 316 MockQuicSpdySession::~MockQuicSpdySession() {} | 316 MockQuicSpdySession::~MockQuicSpdySession() {} |
| 317 | 317 |
| 318 // static | 318 // static |
| 319 QuicConsumedData MockQuicSpdySession::ConsumeAllData( | 319 QuicConsumedData MockQuicSpdySession::ConsumeAllData( |
| 320 QuicStreamId /*id*/, | 320 QuicStreamId /*id*/, |
| 321 const QuicIOVector& data, | 321 const QuicIOVector& data, |
| 322 QuicStreamOffset /*offset*/, | 322 QuicStreamOffset /*offset*/, |
| 323 bool fin, | 323 bool fin, |
| 324 FecProtection /*fec_protection*/, | |
| 325 QuicAckListenerInterface* /*ack_notifier_delegate*/) { | 324 QuicAckListenerInterface* /*ack_notifier_delegate*/) { |
| 326 return QuicConsumedData(data.total_length, fin); | 325 return QuicConsumedData(data.total_length, fin); |
| 327 } | 326 } |
| 328 | 327 |
| 329 TestQuicSpdyServerSession::TestQuicSpdyServerSession( | 328 TestQuicSpdyServerSession::TestQuicSpdyServerSession( |
| 330 QuicConnection* connection, | 329 QuicConnection* connection, |
| 331 const QuicConfig& config, | 330 const QuicConfig& config, |
| 332 const QuicCryptoServerConfig* crypto_config) | 331 const QuicCryptoServerConfig* crypto_config) |
| 333 : QuicServerSessionBase(config, connection, &visitor_, crypto_config) { | 332 : QuicServerSessionBase(config, connection, &visitor_, crypto_config) { |
| 334 Initialize(); | 333 Initialize(); |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 // strike register worries that we've just overflowed a uint32_t time. | 789 // strike register worries that we've just overflowed a uint32_t time. |
| 791 (*server_connection)->AdvanceTime(connection_start_time); | 790 (*server_connection)->AdvanceTime(connection_start_time); |
| 792 } | 791 } |
| 793 | 792 |
| 794 QuicStreamId QuicClientDataStreamId(int i) { | 793 QuicStreamId QuicClientDataStreamId(int i) { |
| 795 return kClientDataStreamId1 + 2 * i; | 794 return kClientDataStreamId1 + 2 * i; |
| 796 } | 795 } |
| 797 | 796 |
| 798 } // namespace test | 797 } // namespace test |
| 799 } // namespace net | 798 } // namespace net |
| OLD | NEW |