| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/quic_data_stream.h" | 5 #include "net/quic/quic_data_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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 292 |
| 293 // Try to send more data than the flow control limit allows. | 293 // Try to send more data than the flow control limit allows. |
| 294 string headers = SpdyUtils::SerializeUncompressedHeaders(headers_); | 294 string headers = SpdyUtils::SerializeUncompressedHeaders(headers_); |
| 295 string body; | 295 string body; |
| 296 const uint64 kOverflow = 15; | 296 const uint64 kOverflow = 15; |
| 297 GenerateBody(&body, kWindow + kOverflow); | 297 GenerateBody(&body, kWindow + kOverflow); |
| 298 | 298 |
| 299 EXPECT_CALL(*connection_, SendBlocked(kClientDataStreamId1)); | 299 EXPECT_CALL(*connection_, SendBlocked(kClientDataStreamId1)); |
| 300 EXPECT_CALL(*session_, WritevData(kClientDataStreamId1, _, _, _, _, _)) | 300 EXPECT_CALL(*session_, WritevData(kClientDataStreamId1, _, _, _, _, _)) |
| 301 .WillOnce(Return(QuicConsumedData(kWindow, true))); | 301 .WillOnce(Return(QuicConsumedData(kWindow, true))); |
| 302 stream_->WriteOrBufferData(body, false, NULL); | 302 stream_->WriteOrBufferData(body, false, nullptr); |
| 303 | 303 |
| 304 // Should have sent as much as possible, resulting in no send window left. | 304 // Should have sent as much as possible, resulting in no send window left. |
| 305 EXPECT_EQ(0u, | 305 EXPECT_EQ(0u, |
| 306 QuicFlowControllerPeer::SendWindowSize(stream_->flow_controller())); | 306 QuicFlowControllerPeer::SendWindowSize(stream_->flow_controller())); |
| 307 | 307 |
| 308 // And we should have queued the overflowed data. | 308 // And we should have queued the overflowed data. |
| 309 EXPECT_EQ(kOverflow, | 309 EXPECT_EQ(kOverflow, |
| 310 ReliableQuicStreamPeer::SizeOfQueuedData(stream_.get())); | 310 ReliableQuicStreamPeer::SizeOfQueuedData(stream_.get())); |
| 311 } | 311 } |
| 312 | 312 |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 stream_->flow_controller())); | 528 stream_->flow_controller())); |
| 529 | 529 |
| 530 // Send a frame with a FIN but no data. This should not be blocked. | 530 // Send a frame with a FIN but no data. This should not be blocked. |
| 531 string body = ""; | 531 string body = ""; |
| 532 bool fin = true; | 532 bool fin = true; |
| 533 | 533 |
| 534 EXPECT_CALL(*connection_, SendBlocked(kClientDataStreamId1)).Times(0); | 534 EXPECT_CALL(*connection_, SendBlocked(kClientDataStreamId1)).Times(0); |
| 535 EXPECT_CALL(*session_, WritevData(kClientDataStreamId1, _, _, _, _, _)) | 535 EXPECT_CALL(*session_, WritevData(kClientDataStreamId1, _, _, _, _, _)) |
| 536 .WillOnce(Return(QuicConsumedData(0, fin))); | 536 .WillOnce(Return(QuicConsumedData(0, fin))); |
| 537 | 537 |
| 538 stream_->WriteOrBufferData(body, fin, NULL); | 538 stream_->WriteOrBufferData(body, fin, nullptr); |
| 539 } | 539 } |
| 540 | 540 |
| 541 } // namespace | 541 } // namespace |
| 542 } // namespace test | 542 } // namespace test |
| 543 } // namespace net | 543 } // namespace net |
| OLD | NEW |