| 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 #include "net/quic/quic_connection.h" | 6 #include "net/quic/quic_connection.h" |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 session_.MarkWriteBlocked(6); | 191 session_.MarkWriteBlocked(6); |
| 192 session_.MarkWriteBlocked(4); | 192 session_.MarkWriteBlocked(4); |
| 193 CloseStream(6); | 193 CloseStream(6); |
| 194 | 194 |
| 195 InSequence s; | 195 InSequence s; |
| 196 EXPECT_CALL(*stream2, OnCanWrite()); | 196 EXPECT_CALL(*stream2, OnCanWrite()); |
| 197 EXPECT_CALL(*stream4, OnCanWrite()); | 197 EXPECT_CALL(*stream4, OnCanWrite()); |
| 198 EXPECT_TRUE(session_.OnCanWrite()); | 198 EXPECT_TRUE(session_.OnCanWrite()); |
| 199 } | 199 } |
| 200 | 200 |
| 201 TEST_F(QuicSessionTest, SendGoAway) { |
| 202 // After sending a GoAway, ensure new incoming streams cannot be created and |
| 203 // result in a RST being sent. |
| 204 EXPECT_CALL(*connection_, |
| 205 SendGoAway(QUIC_PEER_GOING_AWAY, 0u, "Going Away.")); |
| 206 session_.SendGoAway(QUIC_PEER_GOING_AWAY, "Going Away."); |
| 207 EXPECT_TRUE(session_.goaway_sent()); |
| 208 |
| 209 EXPECT_CALL(*connection_, SendRstStream(3u, QUIC_PEER_GOING_AWAY)); |
| 210 EXPECT_FALSE(session_.GetIncomingReliableStream(3u)); |
| 211 } |
| 201 } // namespace | 212 } // namespace |
| 202 } // namespace test | 213 } // namespace test |
| 203 } // namespace net | 214 } // namespace net |
| OLD | NEW |