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_flags.h" | 9 #include "net/quic/quic_flags.h" |
10 #include "net/quic/quic_utils.h" | 10 #include "net/quic/quic_utils.h" |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 // higher than the receive window offset. | 643 // higher than the receive window offset. |
644 QuicStreamFrame frame(stream_->id(), false, | 644 QuicStreamFrame frame(stream_->id(), false, |
645 kInitialSessionFlowControlWindowForTest + 1, | 645 kInitialSessionFlowControlWindowForTest + 1, |
646 MakeIOVector(".")); | 646 MakeIOVector(".")); |
647 EXPECT_GT(frame.offset, QuicFlowControllerPeer::ReceiveWindowOffset( | 647 EXPECT_GT(frame.offset, QuicFlowControllerPeer::ReceiveWindowOffset( |
648 stream_->flow_controller())); | 648 stream_->flow_controller())); |
649 | 649 |
650 // Stream should not accept the frame, and the connection should be closed. | 650 // Stream should not accept the frame, and the connection should be closed. |
651 EXPECT_CALL(*connection_, | 651 EXPECT_CALL(*connection_, |
652 SendConnectionClose(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA)); | 652 SendConnectionClose(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA)); |
653 EXPECT_FALSE(stream_->OnStreamFrame(frame)); | 653 stream_->OnStreamFrame(frame); |
654 } | 654 } |
655 | 655 |
656 TEST_F(ReliableQuicStreamTest, FinalByteOffsetFromFin) { | 656 TEST_F(ReliableQuicStreamTest, FinalByteOffsetFromFin) { |
657 Initialize(kShouldProcessData); | 657 Initialize(kShouldProcessData); |
658 | 658 |
659 EXPECT_FALSE(stream_->HasFinalReceivedByteOffset()); | 659 EXPECT_FALSE(stream_->HasFinalReceivedByteOffset()); |
660 | 660 |
661 QuicStreamFrame stream_frame_no_fin(stream_->id(), false, 1234, | 661 QuicStreamFrame stream_frame_no_fin(stream_->id(), false, 1234, |
662 MakeIOVector(".")); | 662 MakeIOVector(".")); |
663 stream_->OnStreamFrame(stream_frame_no_fin); | 663 stream_->OnStreamFrame(stream_frame_no_fin); |
(...skipping 10 matching lines...) Expand all Loading... |
674 | 674 |
675 EXPECT_FALSE(stream_->HasFinalReceivedByteOffset()); | 675 EXPECT_FALSE(stream_->HasFinalReceivedByteOffset()); |
676 QuicRstStreamFrame rst_frame(stream_->id(), QUIC_STREAM_CANCELLED, 1234); | 676 QuicRstStreamFrame rst_frame(stream_->id(), QUIC_STREAM_CANCELLED, 1234); |
677 stream_->OnStreamReset(rst_frame); | 677 stream_->OnStreamReset(rst_frame); |
678 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); | 678 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); |
679 } | 679 } |
680 | 680 |
681 } // namespace | 681 } // namespace |
682 } // namespace test | 682 } // namespace test |
683 } // namespace net | 683 } // namespace net |
OLD | NEW |