| 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/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 | 1155 |
| 1156 // Reset stream locally. | 1156 // Reset stream locally. |
| 1157 EXPECT_CALL(*connection_, SendRstStream(stream->id(), _, _)); | 1157 EXPECT_CALL(*connection_, SendRstStream(stream->id(), _, _)); |
| 1158 stream->Reset(QUIC_STREAM_CANCELLED); | 1158 stream->Reset(QUIC_STREAM_CANCELLED); |
| 1159 EXPECT_TRUE(ReliableQuicStreamPeer::read_side_closed(stream)); | 1159 EXPECT_TRUE(ReliableQuicStreamPeer::read_side_closed(stream)); |
| 1160 | 1160 |
| 1161 // Allow the session to delete the stream object. | 1161 // Allow the session to delete the stream object. |
| 1162 session_.PostProcessAfterData(); | 1162 session_.PostProcessAfterData(); |
| 1163 EXPECT_TRUE(connection_->connected()); | 1163 EXPECT_TRUE(connection_->connected()); |
| 1164 EXPECT_TRUE(QuicSessionPeer::IsStreamClosed(&session_, stream_id)); | 1164 EXPECT_TRUE(QuicSessionPeer::IsStreamClosed(&session_, stream_id)); |
| 1165 EXPECT_EQ(nullptr, QuicSessionPeer::dynamic_streams(&session_)[stream_id]); | 1165 EXPECT_FALSE(QuicSessionPeer::IsStreamCreated(&session_, stream_id)); |
| 1166 | 1166 |
| 1167 // The stream is not waiting for the arrival of the peer's final offset as it | 1167 // The stream is not waiting for the arrival of the peer's final offset as it |
| 1168 // was received with the FIN earlier. | 1168 // was received with the FIN earlier. |
| 1169 EXPECT_EQ( | 1169 EXPECT_EQ( |
| 1170 0u, | 1170 0u, |
| 1171 QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(&session_).size()); | 1171 QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(&session_).size()); |
| 1172 } | 1172 } |
| 1173 | 1173 |
| 1174 TEST_P(QuicSessionTestClient, TestMaxIncomingAndOutgoingStreamsAllowed) { | 1174 TEST_P(QuicSessionTestClient, TestMaxIncomingAndOutgoingStreamsAllowed) { |
| 1175 // Tests that on client side, the value of max_open_incoming/outgoing streams | 1175 // Tests that on client side, the value of max_open_incoming/outgoing streams |
| 1176 // are setup correctly during negotiation. | 1176 // are setup correctly during negotiation. |
| 1177 // When flag is true, the value for outgoing stream is limited to negotiated | 1177 // When flag is true, the value for outgoing stream is limited to negotiated |
| 1178 // value and for incoming stream it is set to be larger than that. | 1178 // value and for incoming stream it is set to be larger than that. |
| 1179 session_.OnConfigNegotiated(); | 1179 session_.OnConfigNegotiated(); |
| 1180 EXPECT_LT(session_.max_open_outgoing_streams(), | 1180 EXPECT_LT(session_.max_open_outgoing_streams(), |
| 1181 session_.max_open_incoming_streams()); | 1181 session_.max_open_incoming_streams()); |
| 1182 EXPECT_EQ(session_.max_open_outgoing_streams(), | 1182 EXPECT_EQ(session_.max_open_outgoing_streams(), |
| 1183 kDefaultMaxStreamsPerConnection); | 1183 kDefaultMaxStreamsPerConnection); |
| 1184 } | 1184 } |
| 1185 | 1185 |
| 1186 } // namespace | 1186 } // namespace |
| 1187 } // namespace test | 1187 } // namespace test |
| 1188 } // namespace net | 1188 } // namespace net |
| OLD | NEW |