| 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 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 EXPECT_CALL(*connection, SendRstStream(3, QUIC_STREAM_CANCELLED)); | 450 EXPECT_CALL(*connection, SendRstStream(3, QUIC_STREAM_CANCELLED)); |
| 451 session.SendRstStream(3, QUIC_STREAM_CANCELLED); | 451 session.SendRstStream(3, QUIC_STREAM_CANCELLED); |
| 452 | 452 |
| 453 EXPECT_EQ(1u, session.GetNumOpenStreams()); | 453 EXPECT_EQ(1u, session.GetNumOpenStreams()); |
| 454 | 454 |
| 455 connection->CloseConnection(QUIC_CONNECTION_TIMED_OUT, false); | 455 connection->CloseConnection(QUIC_CONNECTION_TIMED_OUT, false); |
| 456 | 456 |
| 457 EXPECT_EQ(0u, session.GetNumOpenStreams()); | 457 EXPECT_EQ(0u, session.GetNumOpenStreams()); |
| 458 } | 458 } |
| 459 | 459 |
| 460 TEST_F(QuicSessionTest, RstStreamBeforeHeadersDecompressed) { |
| 461 // Send two bytes of payload. |
| 462 QuicStreamFrame data1(3, false, 0, MakeIOVector("HT")); |
| 463 vector<QuicStreamFrame> frames; |
| 464 frames.push_back(data1); |
| 465 EXPECT_TRUE(session_.OnStreamFrames(frames)); |
| 466 EXPECT_EQ(1u, session_.GetNumOpenStreams()); |
| 467 |
| 468 // Send a reset before the headers have been decompressed. This causes |
| 469 // an unrecoverable compression context state. |
| 470 EXPECT_CALL(*connection_, SendConnectionClose( |
| 471 QUIC_STREAM_RST_BEFORE_HEADERS_DECOMPRESSED)); |
| 472 |
| 473 QuicRstStreamFrame rst1(3, QUIC_STREAM_NO_ERROR); |
| 474 session_.OnRstStream(rst1); |
| 475 EXPECT_EQ(0u, session_.GetNumOpenStreams()); |
| 476 } |
| 477 |
| 460 } // namespace | 478 } // namespace |
| 461 } // namespace test | 479 } // namespace test |
| 462 } // namespace net | 480 } // namespace net |
| OLD | NEW |