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_spdy_stream.h" | 5 #include "net/quic/quic_spdy_stream.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 CloseConnection(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, _, _)); | 622 CloseConnection(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, _, _)); |
623 stream_->OnStreamFrame(frame); | 623 stream_->OnStreamFrame(frame); |
624 } | 624 } |
625 | 625 |
626 TEST_P(QuicSpdyStreamTest, TestHandlingQuicRstStreamNoError) { | 626 TEST_P(QuicSpdyStreamTest, TestHandlingQuicRstStreamNoError) { |
627 Initialize(kShouldProcessData); | 627 Initialize(kShouldProcessData); |
628 string headers = SpdyUtils::SerializeUncompressedHeaders(headers_); | 628 string headers = SpdyUtils::SerializeUncompressedHeaders(headers_); |
629 stream_->OnStreamHeaders(headers); | 629 stream_->OnStreamHeaders(headers); |
630 stream_->OnStreamHeadersComplete(false, headers.size()); | 630 stream_->OnStreamHeadersComplete(false, headers.size()); |
631 | 631 |
632 if (GetParam() <= QUIC_VERSION_28) { | |
633 EXPECT_CALL(*session_, SendRstStream(_, _, _)); | |
634 } | |
635 stream_->OnStreamReset( | 632 stream_->OnStreamReset( |
636 QuicRstStreamFrame(stream_->id(), QUIC_STREAM_NO_ERROR, 0)); | 633 QuicRstStreamFrame(stream_->id(), QUIC_STREAM_NO_ERROR, 0)); |
637 EXPECT_TRUE(stream_->write_side_closed()); | 634 EXPECT_TRUE(stream_->write_side_closed()); |
638 if (GetParam() > QUIC_VERSION_28) { | 635 EXPECT_FALSE(stream_->reading_stopped()); |
639 EXPECT_FALSE(stream_->reading_stopped()); | |
640 } else { | |
641 EXPECT_TRUE(stream_->reading_stopped()); | |
642 } | |
643 } | 636 } |
644 | 637 |
645 TEST_P(QuicSpdyStreamTest, ConnectionFlowControlViolation) { | 638 TEST_P(QuicSpdyStreamTest, ConnectionFlowControlViolation) { |
646 // Tests that on if the peer sends too much data (i.e. violates the flow | 639 // Tests that on if the peer sends too much data (i.e. violates the flow |
647 // control protocol), at the connection level (rather than the stream level) | 640 // control protocol), at the connection level (rather than the stream level) |
648 // then we terminate the connection. | 641 // then we terminate the connection. |
649 | 642 |
650 // Stream should not process data, so that data gets buffered in the | 643 // Stream should not process data, so that data gets buffered in the |
651 // sequencer, triggering flow control limits. | 644 // sequencer, triggering flow control limits. |
652 Initialize(!kShouldProcessData); | 645 Initialize(!kShouldProcessData); |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 | 987 |
995 // Writing Trailers should fail, as the FIN has already been sent. | 988 // Writing Trailers should fail, as the FIN has already been sent. |
996 // populated with the number of body bytes written. | 989 // populated with the number of body bytes written. |
997 EXPECT_DFATAL(stream_->WriteTrailers(SpdyHeaderBlock(), nullptr), | 990 EXPECT_DFATAL(stream_->WriteTrailers(SpdyHeaderBlock(), nullptr), |
998 "Trailers cannot be sent after a FIN"); | 991 "Trailers cannot be sent after a FIN"); |
999 } | 992 } |
1000 | 993 |
1001 } // namespace | 994 } // namespace |
1002 } // namespace test | 995 } // namespace test |
1003 } // namespace net | 996 } // namespace net |
OLD | NEW |