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