| 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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 // the request, the received FIN is recorded. | 731 // the request, the received FIN is recorded. |
| 732 | 732 |
| 733 Initialize(kShouldProcessData); | 733 Initialize(kShouldProcessData); |
| 734 EXPECT_CALL(*connection_, SendConnectionClose(_)).Times(0); | 734 EXPECT_CALL(*connection_, SendConnectionClose(_)).Times(0); |
| 735 EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _)) | 735 EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _)) |
| 736 .WillRepeatedly(Invoke(MockQuicSpdySession::ConsumeAllData)); | 736 .WillRepeatedly(Invoke(MockQuicSpdySession::ConsumeAllData)); |
| 737 | 737 |
| 738 // Receive data for the request. | 738 // Receive data for the request. |
| 739 QuicStreamFrame frame1(stream_->id(), false, 0, StringPiece("Start")); | 739 QuicStreamFrame frame1(stream_->id(), false, 0, StringPiece("Start")); |
| 740 stream_->OnStreamFrame(frame1); | 740 stream_->OnStreamFrame(frame1); |
| 741 // When QuicSpdyServerStream sends the response, it calls | 741 // When QuicSimpleServerStream sends the response, it calls |
| 742 // ReliableQuicStream::CloseReadSide() first. | 742 // ReliableQuicStream::CloseReadSide() first. |
| 743 ReliableQuicStreamPeer::CloseReadSide(stream_); | 743 ReliableQuicStreamPeer::CloseReadSide(stream_); |
| 744 // Send data and FIN for the response. | 744 // Send data and FIN for the response. |
| 745 stream_->WriteOrBufferData(kData1, false, nullptr); | 745 stream_->WriteOrBufferData(kData1, false, nullptr); |
| 746 EXPECT_TRUE(ReliableQuicStreamPeer::read_side_closed(stream_)); | 746 EXPECT_TRUE(ReliableQuicStreamPeer::read_side_closed(stream_)); |
| 747 // Receive remaining data and FIN for the request. | 747 // Receive remaining data and FIN for the request. |
| 748 QuicStreamFrame frame2(stream_->id(), true, 0, StringPiece("End")); | 748 QuicStreamFrame frame2(stream_->id(), true, 0, StringPiece("End")); |
| 749 stream_->OnStreamFrame(frame2); | 749 stream_->OnStreamFrame(frame2); |
| 750 EXPECT_TRUE(stream_->fin_received()); | 750 EXPECT_TRUE(stream_->fin_received()); |
| 751 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); | 751 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); |
| 752 } | 752 } |
| 753 | 753 |
| 754 } // namespace | 754 } // namespace |
| 755 } // namespace test | 755 } // namespace test |
| 756 } // namespace net | 756 } // namespace net |
| OLD | NEW |