| 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_connection.h" | 7 #include "net/quic/quic_connection.h" |
| 8 #include "net/quic/quic_flags.h" | 8 #include "net/quic/quic_flags.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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 "Rgj3RWUoPumQVCxtSOBdX0GlJOEcDTNCzQIm9BSfetog_eP_TfYubKudt5eMsXmN6" | 97 "Rgj3RWUoPumQVCxtSOBdX0GlJOEcDTNCzQIm9BSfetog_eP_TfYubKudt5eMsXmN6" |
| 98 "QnyXHeGeK2UINUzJ-D30AFcpqYgH9_1BvYSpi7fc7_ydBU8TaD8ZRxvtnzXqj0RfG" | 98 "QnyXHeGeK2UINUzJ-D30AFcpqYgH9_1BvYSpi7fc7_ydBU8TaD8ZRxvtnzXqj0RfG" |
| 99 "tuHghmv3aD-uzSYJ75XDdzKdizZ86IG6Fbn1XFhYZM-fbHhm3mVEXnyRW4ZuNOLFk" | 99 "tuHghmv3aD-uzSYJ75XDdzKdizZ86IG6Fbn1XFhYZM-fbHhm3mVEXnyRW4ZuNOLFk" |
| 100 "Fas6LMcVC6Q8QLlHYbXBpdNFuGbuZGUnav5C-2I_-46lL0NGg3GewxGKGHvHEfoyn" | 100 "Fas6LMcVC6Q8QLlHYbXBpdNFuGbuZGUnav5C-2I_-46lL0NGg3GewxGKGHvHEfoyn" |
| 101 "EFFlEYHsBQ98rXImL8ySDycdLEFvBPdtctPmWCfTxwmoSMLHU2SCVDhbqMWU5b0yr" | 101 "EFFlEYHsBQ98rXImL8ySDycdLEFvBPdtctPmWCfTxwmoSMLHU2SCVDhbqMWU5b0yr" |
| 102 "JBCScs_ejbKaqBDoB7ZGxTvqlrB__2ZmnHHjCr8RgMRtKNtIeuZAo "; | 102 "JBCScs_ejbKaqBDoB7ZGxTvqlrB__2ZmnHHjCr8RgMRtKNtIeuZAo "; |
| 103 } | 103 } |
| 104 | 104 |
| 105 void Initialize(bool stream_should_process_data) { | 105 void Initialize(bool stream_should_process_data) { |
| 106 connection_ = new StrictMock<MockConnection>( | 106 connection_ = new StrictMock<MockConnection>( |
| 107 &helper_, Perspective::IS_SERVER, supported_versions_); | 107 &helper_, &alarm_factory_, Perspective::IS_SERVER, supported_versions_); |
| 108 session_.reset(new StrictMock<MockQuicSpdySession>(connection_)); | 108 session_.reset(new StrictMock<MockQuicSpdySession>(connection_)); |
| 109 | 109 |
| 110 // New streams rely on having the peer's flow control receive window | 110 // New streams rely on having the peer's flow control receive window |
| 111 // negotiated in the config. | 111 // negotiated in the config. |
| 112 QuicConfigPeer::SetReceivedInitialStreamFlowControlWindow( | 112 QuicConfigPeer::SetReceivedInitialStreamFlowControlWindow( |
| 113 session_->config(), initial_flow_control_window_bytes_); | 113 session_->config(), initial_flow_control_window_bytes_); |
| 114 | 114 |
| 115 stream_ = new TestStream(kTestStreamId, session_.get(), | 115 stream_ = new TestStream(kTestStreamId, session_.get(), |
| 116 stream_should_process_data); | 116 stream_should_process_data); |
| 117 // session_ now owns stream_. | 117 // session_ now owns stream_. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 141 QuicIOVector /*iov*/, | 141 QuicIOVector /*iov*/, |
| 142 QuicStreamOffset /*offset*/, | 142 QuicStreamOffset /*offset*/, |
| 143 bool /*fin*/, | 143 bool /*fin*/, |
| 144 QuicAckListenerInterface* /*ack_notifier_delegate*/) { | 144 QuicAckListenerInterface* /*ack_notifier_delegate*/) { |
| 145 session_->CloseStream(id); | 145 session_->CloseStream(id); |
| 146 return QuicConsumedData(1, false); | 146 return QuicConsumedData(1, false); |
| 147 } | 147 } |
| 148 | 148 |
| 149 protected: | 149 protected: |
| 150 MockConnectionHelper helper_; | 150 MockConnectionHelper helper_; |
| 151 MockAlarmFactory alarm_factory_; |
| 151 MockConnection* connection_; | 152 MockConnection* connection_; |
| 152 std::unique_ptr<MockQuicSpdySession> session_; | 153 std::unique_ptr<MockQuicSpdySession> session_; |
| 153 TestStream* stream_; | 154 TestStream* stream_; |
| 154 SpdyHeaderBlock headers_; | 155 SpdyHeaderBlock headers_; |
| 155 QuicWriteBlockedList* write_blocked_list_; | 156 QuicWriteBlockedList* write_blocked_list_; |
| 156 uint32_t initial_flow_control_window_bytes_; | 157 uint32_t initial_flow_control_window_bytes_; |
| 157 QuicTime::Delta zero_; | 158 QuicTime::Delta zero_; |
| 158 QuicVersionVector supported_versions_; | 159 QuicVersionVector supported_versions_; |
| 159 const QuicStreamId kTestStreamId = 5u; | 160 const QuicStreamId kTestStreamId = 5u; |
| 160 }; | 161 }; |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 // Receive remaining data and FIN for the request. | 658 // Receive remaining data and FIN for the request. |
| 658 QuicStreamFrame frame2(stream_->id(), true, 0, StringPiece("End")); | 659 QuicStreamFrame frame2(stream_->id(), true, 0, StringPiece("End")); |
| 659 stream_->OnStreamFrame(frame2); | 660 stream_->OnStreamFrame(frame2); |
| 660 EXPECT_TRUE(stream_->fin_received()); | 661 EXPECT_TRUE(stream_->fin_received()); |
| 661 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); | 662 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); |
| 662 } | 663 } |
| 663 | 664 |
| 664 } // namespace | 665 } // namespace |
| 665 } // namespace test | 666 } // namespace test |
| 666 } // namespace net | 667 } // namespace net |
| OLD | NEW |