| 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/reliable_quic_stream.h" | 5 #include "net/quic/reliable_quic_stream.h" |
| 6 | 6 |
| 7 #include "net/quic/quic_ack_notifier.h" | 7 #include "net/quic/quic_ack_notifier.h" |
| 8 #include "net/quic/quic_connection.h" | 8 #include "net/quic/quic_connection.h" |
| 9 #include "net/quic/quic_utils.h" | 9 #include "net/quic/quic_utils.h" |
| 10 #include "net/quic/quic_write_blocked_list.h" | 10 #include "net/quic/quic_write_blocked_list.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 supported_versions_ = versions; | 109 supported_versions_ = versions; |
| 110 } | 110 } |
| 111 | 111 |
| 112 void Initialize(bool stream_should_process_data) { | 112 void Initialize(bool stream_should_process_data) { |
| 113 connection_ = | 113 connection_ = |
| 114 new StrictMock<MockConnection>(kIsServer, supported_versions_); | 114 new StrictMock<MockConnection>(kIsServer, supported_versions_); |
| 115 session_.reset(new StrictMock<MockSession>(connection_)); | 115 session_.reset(new StrictMock<MockSession>(connection_)); |
| 116 | 116 |
| 117 // New streams rely on having the peer's flow control receive window | 117 // New streams rely on having the peer's flow control receive window |
| 118 // negotiated in the config. | 118 // negotiated in the config. |
| 119 QuicConfigPeer::SetReceivedInitialFlowControlWindow( | |
| 120 session_->config(), initial_flow_control_window_bytes_); | |
| 121 QuicConfigPeer::SetReceivedInitialStreamFlowControlWindow( | 119 QuicConfigPeer::SetReceivedInitialStreamFlowControlWindow( |
| 122 session_->config(), initial_flow_control_window_bytes_); | 120 session_->config(), initial_flow_control_window_bytes_); |
| 123 | 121 |
| 124 stream_.reset(new TestStream(kHeadersStreamId, session_.get(), | 122 stream_.reset(new TestStream(kHeadersStreamId, session_.get(), |
| 125 stream_should_process_data)); | 123 stream_should_process_data)); |
| 126 write_blocked_list_ = | 124 write_blocked_list_ = |
| 127 QuicSessionPeer::GetWriteBlockedStreams(session_.get()); | 125 QuicSessionPeer::GetWriteBlockedStreams(session_.get()); |
| 128 } | 126 } |
| 129 | 127 |
| 130 bool fin_sent() { return ReliableQuicStreamPeer::FinSent(stream_.get()); } | 128 bool fin_sent() { return ReliableQuicStreamPeer::FinSent(stream_.get()); } |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 | 642 |
| 645 EXPECT_FALSE(stream_->HasFinalReceivedByteOffset()); | 643 EXPECT_FALSE(stream_->HasFinalReceivedByteOffset()); |
| 646 QuicRstStreamFrame rst_frame(stream_->id(), QUIC_STREAM_CANCELLED, 1234); | 644 QuicRstStreamFrame rst_frame(stream_->id(), QUIC_STREAM_CANCELLED, 1234); |
| 647 stream_->OnStreamReset(rst_frame); | 645 stream_->OnStreamReset(rst_frame); |
| 648 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); | 646 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); |
| 649 } | 647 } |
| 650 | 648 |
| 651 } // namespace | 649 } // namespace |
| 652 } // namespace test | 650 } // namespace test |
| 653 } // namespace net | 651 } // namespace net |
| OLD | NEW |