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/core/reliable_quic_stream.h" | 5 #include "net/quic/core/reliable_quic_stream.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "net/quic/core/quic_connection.h" | 9 #include "net/quic/core/quic_connection.h" |
10 #include "net/quic/core/quic_flags.h" | 10 #include "net/quic/core/quic_flags.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 .WillOnce(Return(QuicConsumedData(kDataLen, true))); | 177 .WillOnce(Return(QuicConsumedData(kDataLen, true))); |
178 stream_->WriteOrBufferData(kData1, false, nullptr); | 178 stream_->WriteOrBufferData(kData1, false, nullptr); |
179 EXPECT_FALSE(HasWriteBlockedStreams()); | 179 EXPECT_FALSE(HasWriteBlockedStreams()); |
180 } | 180 } |
181 | 181 |
182 TEST_F(ReliableQuicStreamTest, NoBlockingIfNoDataOrFin) { | 182 TEST_F(ReliableQuicStreamTest, NoBlockingIfNoDataOrFin) { |
183 Initialize(kShouldProcessData); | 183 Initialize(kShouldProcessData); |
184 | 184 |
185 // Write no data and no fin. If we consume nothing we should not be write | 185 // Write no data and no fin. If we consume nothing we should not be write |
186 // blocked. | 186 // blocked. |
187 EXPECT_DFATAL(stream_->WriteOrBufferData(StringPiece(), false, nullptr), ""); | 187 EXPECT_QUIC_BUG(stream_->WriteOrBufferData(StringPiece(), false, nullptr), |
| 188 ""); |
188 EXPECT_FALSE(HasWriteBlockedStreams()); | 189 EXPECT_FALSE(HasWriteBlockedStreams()); |
189 } | 190 } |
190 | 191 |
191 TEST_F(ReliableQuicStreamTest, BlockIfOnlySomeDataConsumed) { | 192 TEST_F(ReliableQuicStreamTest, BlockIfOnlySomeDataConsumed) { |
192 Initialize(kShouldProcessData); | 193 Initialize(kShouldProcessData); |
193 | 194 |
194 // Write some data and no fin. If we consume some but not all of the data, | 195 // Write some data and no fin. If we consume some but not all of the data, |
195 // we should be write blocked a not all the data was consumed. | 196 // we should be write blocked a not all the data was consumed. |
196 EXPECT_CALL(*session_, WritevData(stream_, kTestStreamId, _, _, _, _)) | 197 EXPECT_CALL(*session_, WritevData(stream_, kTestStreamId, _, _, _, _)) |
197 .WillOnce(Return(QuicConsumedData(1, false))); | 198 .WillOnce(Return(QuicConsumedData(1, false))); |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 // Receive remaining data and FIN for the request. | 707 // Receive remaining data and FIN for the request. |
707 QuicStreamFrame frame2(stream_->id(), true, 0, StringPiece("End")); | 708 QuicStreamFrame frame2(stream_->id(), true, 0, StringPiece("End")); |
708 stream_->OnStreamFrame(frame2); | 709 stream_->OnStreamFrame(frame2); |
709 EXPECT_TRUE(stream_->fin_received()); | 710 EXPECT_TRUE(stream_->fin_received()); |
710 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); | 711 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); |
711 } | 712 } |
712 | 713 |
713 } // namespace | 714 } // namespace |
714 } // namespace test | 715 } // namespace test |
715 } // namespace net | 716 } // namespace net |
OLD | NEW |