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/core/quic_session.h" | 5 #include "net/quic/core/quic_session.h" |
6 | 6 |
7 #include <cstdint> | 7 #include <cstdint> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 session_.max_open_incoming_streams()); | 1249 session_.max_open_incoming_streams()); |
1250 EXPECT_EQ(session_.max_open_outgoing_streams(), | 1250 EXPECT_EQ(session_.max_open_outgoing_streams(), |
1251 kDefaultMaxStreamsPerConnection); | 1251 kDefaultMaxStreamsPerConnection); |
1252 EXPECT_GT(session_.max_open_incoming_streams(), | 1252 EXPECT_GT(session_.max_open_incoming_streams(), |
1253 kDefaultMaxStreamsPerConnection); | 1253 kDefaultMaxStreamsPerConnection); |
1254 } | 1254 } |
1255 | 1255 |
1256 TEST_P(QuicSessionTestServer, EnableFHOLThroughConfigOption) { | 1256 TEST_P(QuicSessionTestServer, EnableFHOLThroughConfigOption) { |
1257 QuicConfigPeer::SetReceivedForceHolBlocking(session_.config()); | 1257 QuicConfigPeer::SetReceivedForceHolBlocking(session_.config()); |
1258 session_.OnConfigNegotiated(); | 1258 session_.OnConfigNegotiated(); |
1259 if (version() != QUIC_VERSION_36) { | 1259 if (version() != QUIC_VERSION_36 || session_.use_stream_notifier()) { |
1260 EXPECT_FALSE(session_.force_hol_blocking()); | 1260 EXPECT_FALSE(session_.force_hol_blocking()); |
1261 } else { | 1261 } else { |
1262 EXPECT_TRUE(session_.force_hol_blocking()); | 1262 EXPECT_TRUE(session_.force_hol_blocking()); |
1263 } | 1263 } |
1264 } | 1264 } |
1265 | 1265 |
1266 class QuicSessionTestClient : public QuicSessionTestBase { | 1266 class QuicSessionTestClient : public QuicSessionTestBase { |
1267 protected: | 1267 protected: |
1268 QuicSessionTestClient() : QuicSessionTestBase(Perspective::IS_CLIENT) {} | 1268 QuicSessionTestClient() : QuicSessionTestBase(Perspective::IS_CLIENT) {} |
1269 }; | 1269 }; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1334 QuicConfigPeer::SetConnectionOptionsToSend(session_.config(), copt); | 1334 QuicConfigPeer::SetConnectionOptionsToSend(session_.config(), copt); |
1335 session_.OnConfigNegotiated(); | 1335 session_.OnConfigNegotiated(); |
1336 EXPECT_EQ( | 1336 EXPECT_EQ( |
1337 QuicSpdySessionPeer::GetSpdyFramer(&session_).header_encoder_table_size(), | 1337 QuicSpdySessionPeer::GetSpdyFramer(&session_).header_encoder_table_size(), |
1338 0UL); | 1338 0UL); |
1339 } | 1339 } |
1340 | 1340 |
1341 TEST_P(QuicSessionTestClient, EnableFHOLThroughConfigOption) { | 1341 TEST_P(QuicSessionTestClient, EnableFHOLThroughConfigOption) { |
1342 session_.config()->SetForceHolBlocking(); | 1342 session_.config()->SetForceHolBlocking(); |
1343 session_.OnConfigNegotiated(); | 1343 session_.OnConfigNegotiated(); |
1344 if (version() != QUIC_VERSION_36) { | 1344 if (version() != QUIC_VERSION_36 || session_.use_stream_notifier()) { |
1345 EXPECT_FALSE(session_.force_hol_blocking()); | 1345 EXPECT_FALSE(session_.force_hol_blocking()); |
1346 } else { | 1346 } else { |
1347 EXPECT_TRUE(session_.force_hol_blocking()); | 1347 EXPECT_TRUE(session_.force_hol_blocking()); |
1348 } | 1348 } |
1349 } | 1349 } |
1350 | 1350 |
1351 TEST_P(QuicSessionTestServer, ZombieStreams) { | 1351 TEST_P(QuicSessionTestServer, ZombieStreams) { |
1352 TestStream* stream2 = session_.CreateOutgoingDynamicStream(kDefaultPriority); | 1352 TestStream* stream2 = session_.CreateOutgoingDynamicStream(kDefaultPriority); |
1353 QuicStreamPeer::SetStreamBytesWritten(3, stream2); | 1353 QuicStreamPeer::SetStreamBytesWritten(3, stream2); |
1354 EXPECT_TRUE(stream2->IsWaitingForAcks()); | 1354 EXPECT_TRUE(stream2->IsWaitingForAcks()); |
1355 | 1355 |
1356 EXPECT_CALL(*connection_, SendRstStream(2, _, _)); | 1356 EXPECT_CALL(*connection_, SendRstStream(2, _, _)); |
1357 session_.CloseStream(2); | 1357 session_.CloseStream(2); |
1358 if (!session_.use_stream_notifier()) { | 1358 if (!session_.use_stream_notifier()) { |
1359 EXPECT_TRUE(session_.zombie_streams().empty()); | 1359 EXPECT_TRUE(session_.zombie_streams().empty()); |
1360 EXPECT_FALSE(session_.closed_streams()->empty()); | 1360 EXPECT_FALSE(session_.closed_streams()->empty()); |
1361 return; | 1361 return; |
1362 } | 1362 } |
1363 EXPECT_TRUE(QuicContainsKey(session_.zombie_streams(), 2)); | 1363 EXPECT_TRUE(QuicContainsKey(session_.zombie_streams(), 2)); |
1364 EXPECT_TRUE(session_.closed_streams()->empty()); | 1364 EXPECT_TRUE(session_.closed_streams()->empty()); |
1365 session_.OnStreamDoneWaitingForAcks(2); | 1365 session_.OnStreamDoneWaitingForAcks(2); |
1366 EXPECT_FALSE(QuicContainsKey(session_.zombie_streams(), 2)); | 1366 EXPECT_FALSE(QuicContainsKey(session_.zombie_streams(), 2)); |
1367 EXPECT_EQ(1u, session_.closed_streams()->size()); | 1367 EXPECT_EQ(1u, session_.closed_streams()->size()); |
1368 EXPECT_EQ(2u, session_.closed_streams()->front()->id()); | 1368 EXPECT_EQ(2u, session_.closed_streams()->front()->id()); |
1369 } | 1369 } |
1370 | 1370 |
1371 } // namespace | 1371 } // namespace |
1372 } // namespace test | 1372 } // namespace test |
1373 } // namespace net | 1373 } // namespace net |
OLD | NEW |