| 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/quic_session.h" | 5 #include "net/quic/quic_session.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds()); | 605 QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds()); |
| 606 } | 606 } |
| 607 | 607 |
| 608 TEST_P(QuicSessionTestServer, RstStreamBeforeHeadersDecompressed) { | 608 TEST_P(QuicSessionTestServer, RstStreamBeforeHeadersDecompressed) { |
| 609 // Send two bytes of payload. | 609 // Send two bytes of payload. |
| 610 QuicStreamFrame data1(kClientDataStreamId1, false, 0, StringPiece("HT")); | 610 QuicStreamFrame data1(kClientDataStreamId1, false, 0, StringPiece("HT")); |
| 611 session_.OnStreamFrame(data1); | 611 session_.OnStreamFrame(data1); |
| 612 EXPECT_EQ(1u, session_.GetNumOpenStreams()); | 612 EXPECT_EQ(1u, session_.GetNumOpenStreams()); |
| 613 | 613 |
| 614 EXPECT_CALL(*connection_, SendRstStream(kClientDataStreamId1, _, _)); | 614 EXPECT_CALL(*connection_, SendRstStream(kClientDataStreamId1, _, _)); |
| 615 QuicRstStreamFrame rst1(kClientDataStreamId1, QUIC_STREAM_NO_ERROR, 0); | 615 QuicRstStreamFrame rst1(kClientDataStreamId1, QUIC_ERROR_PROCESSING_STREAM, |
| 616 0); |
| 616 session_.OnRstStream(rst1); | 617 session_.OnRstStream(rst1); |
| 617 EXPECT_EQ(0u, session_.GetNumOpenStreams()); | 618 EXPECT_EQ(0u, session_.GetNumOpenStreams()); |
| 618 // Connection should remain alive. | 619 // Connection should remain alive. |
| 619 EXPECT_TRUE(connection_->connected()); | 620 EXPECT_TRUE(connection_->connected()); |
| 620 } | 621 } |
| 621 | 622 |
| 622 TEST_P(QuicSessionTestServer, MultipleRstStreamsCauseSingleConnectionClose) { | 623 TEST_P(QuicSessionTestServer, MultipleRstStreamsCauseSingleConnectionClose) { |
| 623 // If multiple invalid reset stream frames arrive in a single packet, this | 624 // If multiple invalid reset stream frames arrive in a single packet, this |
| 624 // should trigger a connection close. However there is no need to send | 625 // should trigger a connection close. However there is no need to send |
| 625 // multiple connection close frames. | 626 // multiple connection close frames. |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 // Verify that there is no entry for the stream in | 1123 // Verify that there is no entry for the stream in |
| 1123 // locally_closed_streams_highest_offset_. | 1124 // locally_closed_streams_highest_offset_. |
| 1124 EXPECT_EQ( | 1125 EXPECT_EQ( |
| 1125 FLAGS_quic_fix_fin_accounting ? 0u : 1u, | 1126 FLAGS_quic_fix_fin_accounting ? 0u : 1u, |
| 1126 QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(&session_).size()); | 1127 QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(&session_).size()); |
| 1127 } | 1128 } |
| 1128 | 1129 |
| 1129 } // namespace | 1130 } // namespace |
| 1130 } // namespace test | 1131 } // namespace test |
| 1131 } // namespace net | 1132 } // namespace net |
| OLD | NEW |