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 <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "net/quic/core/crypto/crypto_framer.h" | 10 #include "net/quic/core/crypto/crypto_framer.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 MockQuicSession::~MockQuicSession() { | 387 MockQuicSession::~MockQuicSession() { |
388 delete connection(); | 388 delete connection(); |
389 } | 389 } |
390 | 390 |
391 // static | 391 // static |
392 QuicConsumedData MockQuicSession::ConsumeAllData( | 392 QuicConsumedData MockQuicSession::ConsumeAllData( |
393 QuicStream* /*stream*/, | 393 QuicStream* /*stream*/, |
394 QuicStreamId /*id*/, | 394 QuicStreamId /*id*/, |
395 const QuicIOVector& data, | 395 const QuicIOVector& data, |
396 QuicStreamOffset /*offset*/, | 396 QuicStreamOffset /*offset*/, |
397 bool fin, | 397 StreamSendingState state, |
398 const QuicReferenceCountedPointer< | 398 const QuicReferenceCountedPointer< |
399 QuicAckListenerInterface>& /*ack_listener*/) { | 399 QuicAckListenerInterface>& /*ack_listener*/) { |
400 return QuicConsumedData(data.total_length, fin); | 400 return QuicConsumedData(data.total_length, state != NO_FIN); |
401 } | 401 } |
402 | 402 |
403 MockQuicSpdySession::MockQuicSpdySession(QuicConnection* connection) | 403 MockQuicSpdySession::MockQuicSpdySession(QuicConnection* connection) |
404 : QuicSpdySession(connection, nullptr, DefaultQuicConfig()) { | 404 : QuicSpdySession(connection, nullptr, DefaultQuicConfig()) { |
405 crypto_stream_.reset(new QuicCryptoStream(this)); | 405 crypto_stream_.reset(new QuicCryptoStream(this)); |
406 Initialize(); | 406 Initialize(); |
407 ON_CALL(*this, WritevData(_, _, _, _, _, _)) | 407 ON_CALL(*this, WritevData(_, _, _, _, _, _)) |
408 .WillByDefault(testing::Return(QuicConsumedData(0, false))); | 408 .WillByDefault(testing::Return(QuicConsumedData(0, false))); |
409 } | 409 } |
410 | 410 |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 // strike register worries that we've just overflowed a uint32_t time. | 850 // strike register worries that we've just overflowed a uint32_t time. |
851 (*server_connection)->AdvanceTime(connection_start_time); | 851 (*server_connection)->AdvanceTime(connection_start_time); |
852 } | 852 } |
853 | 853 |
854 QuicStreamId QuicClientDataStreamId(int i) { | 854 QuicStreamId QuicClientDataStreamId(int i) { |
855 return kClientDataStreamId1 + 2 * i; | 855 return kClientDataStreamId1 + 2 * i; |
856 } | 856 } |
857 | 857 |
858 } // namespace test | 858 } // namespace test |
859 } // namespace net | 859 } // namespace net |
OLD | NEW |