| 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 <string> | 6 #include <string> |
| 7 #include <sys/epoll.h> | 7 #include <sys/epoll.h> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 client_->SendMessage(request); | 875 client_->SendMessage(request); |
| 876 } | 876 } |
| 877 client_->WaitForResponse(); | 877 client_->WaitForResponse(); |
| 878 | 878 |
| 879 EXPECT_FALSE(client_->connected()); | 879 EXPECT_FALSE(client_->connected()); |
| 880 EXPECT_EQ(QUIC_STREAM_CONNECTION_ERROR, client_->stream_error()); | 880 EXPECT_EQ(QUIC_STREAM_CONNECTION_ERROR, client_->stream_error()); |
| 881 EXPECT_EQ(QUIC_TOO_MANY_OPEN_STREAMS, client_->connection_error()); | 881 EXPECT_EQ(QUIC_TOO_MANY_OPEN_STREAMS, client_->connection_error()); |
| 882 } | 882 } |
| 883 | 883 |
| 884 TEST_P(EndToEndTest, NegotiateCongestionControl) { | 884 TEST_P(EndToEndTest, NegotiateCongestionControl) { |
| 885 ValueRestore<bool> old_flag(&FLAGS_quic_allow_bbr, true); |
| 885 ASSERT_TRUE(Initialize()); | 886 ASSERT_TRUE(Initialize()); |
| 886 client_->client()->WaitForCryptoHandshakeConfirmed(); | 887 client_->client()->WaitForCryptoHandshakeConfirmed(); |
| 887 | 888 |
| 888 CongestionControlType expected_congestion_control_type; | 889 CongestionControlType expected_congestion_control_type; |
| 889 switch (GetParam().congestion_control_tag) { | 890 switch (GetParam().congestion_control_tag) { |
| 890 case kRENO: | 891 case kRENO: |
| 891 expected_congestion_control_type = kReno; | 892 expected_congestion_control_type = kReno; |
| 892 break; | 893 break; |
| 893 case kTBBR: | 894 case kTBBR: |
| 894 expected_congestion_control_type = kBBR; | 895 expected_congestion_control_type = kBBR; |
| 895 break; | 896 break; |
| 896 case kQBIC: | 897 case kQBIC: |
| 897 expected_congestion_control_type = kCubic; | 898 expected_congestion_control_type = kCubic; |
| 898 break; | 899 break; |
| 899 default: | 900 default: |
| 900 DLOG(FATAL) << "Unexpected congestion control tag"; | 901 DLOG(FATAL) << "Unexpected congestion control tag"; |
| 901 } | 902 } |
| 902 | 903 |
| 903 EXPECT_EQ(expected_congestion_control_type, | 904 EXPECT_EQ(expected_congestion_control_type, |
| 904 QuicSentPacketManagerPeer::GetCongestionControlAlgorithm( | 905 QuicSentPacketManagerPeer::GetSendAlgorithm( |
| 905 *GetSentPacketManagerFromFirstServerSession()) | 906 *GetSentPacketManagerFromFirstServerSession()) |
| 906 ->GetCongestionControlType()); | 907 ->GetCongestionControlType()); |
| 907 } | 908 } |
| 908 | 909 |
| 909 TEST_P(EndToEndTest, LimitMaxOpenStreams) { | 910 TEST_P(EndToEndTest, LimitMaxOpenStreams) { |
| 910 // Server limits the number of max streams to 2. | 911 // Server limits the number of max streams to 2. |
| 911 server_config_.SetMaxStreamsPerConnection(2, 2); | 912 server_config_.SetMaxStreamsPerConnection(2, 2); |
| 912 // Client tries to negotiate for 10. | 913 // Client tries to negotiate for 10. |
| 913 client_config_.SetMaxStreamsPerConnection(10, 5); | 914 client_config_.SetMaxStreamsPerConnection(10, 5); |
| 914 | 915 |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 QuicSession* session = dispatcher->session_map().begin()->second; | 1359 QuicSession* session = dispatcher->session_map().begin()->second; |
| 1359 EXPECT_EQ(0u, QuicSessionPeer::GetLocallyClosedStreamsHighestOffset( | 1360 EXPECT_EQ(0u, QuicSessionPeer::GetLocallyClosedStreamsHighestOffset( |
| 1360 session).size()); | 1361 session).size()); |
| 1361 server_thread_->Resume(); | 1362 server_thread_->Resume(); |
| 1362 } | 1363 } |
| 1363 | 1364 |
| 1364 } // namespace | 1365 } // namespace |
| 1365 } // namespace test | 1366 } // namespace test |
| 1366 } // namespace tools | 1367 } // namespace tools |
| 1367 } // namespace net | 1368 } // namespace net |
| OLD | NEW |