| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <sys/epoll.h> | 6 #include <sys/epoll.h> |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 case kTBBR: | 1361 case kTBBR: |
| 1362 expected_congestion_control_type = kBBR; | 1362 expected_congestion_control_type = kBBR; |
| 1363 break; | 1363 break; |
| 1364 case kQBIC: | 1364 case kQBIC: |
| 1365 expected_congestion_control_type = kCubic; | 1365 expected_congestion_control_type = kCubic; |
| 1366 break; | 1366 break; |
| 1367 default: | 1367 default: |
| 1368 DLOG(FATAL) << "Unexpected congestion control tag"; | 1368 DLOG(FATAL) << "Unexpected congestion control tag"; |
| 1369 } | 1369 } |
| 1370 | 1370 |
| 1371 server_thread_->Pause(); |
| 1371 EXPECT_EQ(expected_congestion_control_type, | 1372 EXPECT_EQ(expected_congestion_control_type, |
| 1372 QuicSentPacketManagerPeer::GetSendAlgorithm( | 1373 QuicSentPacketManagerPeer::GetSendAlgorithm( |
| 1373 *static_cast<const QuicSentPacketManager*>( | 1374 *static_cast<const QuicSentPacketManager*>( |
| 1374 GetSentPacketManagerFromFirstServerSession())) | 1375 GetSentPacketManagerFromFirstServerSession())) |
| 1375 ->GetCongestionControlType()); | 1376 ->GetCongestionControlType()); |
| 1377 server_thread_->Resume(); |
| 1376 } | 1378 } |
| 1377 | 1379 |
| 1378 TEST_P(EndToEndTest, LimitMaxOpenStreams) { | 1380 TEST_P(EndToEndTest, LimitMaxOpenStreams) { |
| 1379 // Server limits the number of max streams to 2. | 1381 // Server limits the number of max streams to 2. |
| 1380 server_config_.SetMaxStreamsPerConnection(2, 2); | 1382 server_config_.SetMaxStreamsPerConnection(2, 2); |
| 1381 // Client tries to negotiate for 10. | 1383 // Client tries to negotiate for 10. |
| 1382 client_config_.SetMaxStreamsPerConnection(10, 5); | 1384 client_config_.SetMaxStreamsPerConnection(10, 5); |
| 1383 | 1385 |
| 1384 ASSERT_TRUE(Initialize()); | 1386 ASSERT_TRUE(Initialize()); |
| 1385 client_->client()->WaitForCryptoHandshakeConfirmed(); | 1387 client_->client()->WaitForCryptoHandshakeConfirmed(); |
| (...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2921 EXPECT_EQ(kBarResponseBody, client_->response_body()); | 2923 EXPECT_EQ(kBarResponseBody, client_->response_body()); |
| 2922 QuicConnectionStats client_stats = | 2924 QuicConnectionStats client_stats = |
| 2923 client_->client()->session()->connection()->GetStats(); | 2925 client_->client()->session()->connection()->GetStats(); |
| 2924 EXPECT_EQ(0u, client_stats.packets_lost); | 2926 EXPECT_EQ(0u, client_stats.packets_lost); |
| 2925 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); | 2927 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); |
| 2926 } | 2928 } |
| 2927 | 2929 |
| 2928 } // namespace | 2930 } // namespace |
| 2929 } // namespace test | 2931 } // namespace test |
| 2930 } // namespace net | 2932 } // namespace net |
| OLD | NEW |