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 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 server_config_.set_max_streams_per_connection(2, 2); | 936 server_config_.set_max_streams_per_connection(2, 2); |
937 // Client tries to negotiate for 10. | 937 // Client tries to negotiate for 10. |
938 client_config_.set_max_streams_per_connection(10, 5); | 938 client_config_.set_max_streams_per_connection(10, 5); |
939 | 939 |
940 ASSERT_TRUE(Initialize()); | 940 ASSERT_TRUE(Initialize()); |
941 client_->client()->WaitForCryptoHandshakeConfirmed(); | 941 client_->client()->WaitForCryptoHandshakeConfirmed(); |
942 QuicConfig* client_negotiated_config = client_->client()->session()->config(); | 942 QuicConfig* client_negotiated_config = client_->client()->session()->config(); |
943 EXPECT_EQ(2u, client_negotiated_config->max_streams_per_connection()); | 943 EXPECT_EQ(2u, client_negotiated_config->max_streams_per_connection()); |
944 } | 944 } |
945 | 945 |
946 // TODO(rtenneti): DISABLED_LimitCongestionWindowAndRTT seems to be flaky. | 946 TEST_P(EndToEndTest, LimitCongestionWindowAndRTT) { |
947 // http://crbug.com/321870. | |
948 TEST_P(EndToEndTest, DISABLED_LimitCongestionWindowAndRTT) { | |
949 // Client tries to request twice the server's max initial window, and the | 947 // Client tries to request twice the server's max initial window, and the |
950 // server limits it to the max. | 948 // server limits it to the max. |
951 client_config_.SetInitialCongestionWindowToSend(2 * kMaxInitialWindow); | 949 client_config_.SetInitialCongestionWindowToSend(2 * kMaxInitialWindow); |
952 client_config_.SetInitialRoundTripTimeUsToSend(1); | 950 client_config_.SetInitialRoundTripTimeUsToSend(1000); |
953 | 951 |
954 ASSERT_TRUE(Initialize()); | 952 ASSERT_TRUE(Initialize()); |
955 client_->client()->WaitForCryptoHandshakeConfirmed(); | 953 client_->client()->WaitForCryptoHandshakeConfirmed(); |
956 server_thread_->WaitForCryptoHandshakeConfirmed(); | 954 server_thread_->WaitForCryptoHandshakeConfirmed(); |
957 | 955 |
958 // Pause the server so we can access the server's internals without races. | 956 // Pause the server so we can access the server's internals without races. |
959 server_thread_->Pause(); | 957 server_thread_->Pause(); |
960 QuicDispatcher* dispatcher = | 958 QuicDispatcher* dispatcher = |
961 QuicServerPeer::GetDispatcher(server_thread_->server()); | 959 QuicServerPeer::GetDispatcher(server_thread_->server()); |
962 ASSERT_EQ(1u, dispatcher->session_map().size()); | 960 ASSERT_EQ(1u, dispatcher->session_map().size()); |
963 const QuicSentPacketManager& client_sent_packet_manager = | 961 const QuicSentPacketManager& client_sent_packet_manager = |
964 client_->client()->session()->connection()->sent_packet_manager(); | 962 client_->client()->session()->connection()->sent_packet_manager(); |
965 const QuicSentPacketManager& server_sent_packet_manager = | 963 const QuicSentPacketManager& server_sent_packet_manager = |
966 *GetSentPacketManagerFromFirstServerSession(); | 964 *GetSentPacketManagerFromFirstServerSession(); |
967 | 965 |
968 // The client shouldn't set it's initial window based on the negotiated value. | 966 // The client shouldn't set it's initial window based on the negotiated value. |
969 EXPECT_EQ(kDefaultInitialWindow * kDefaultTCPMSS, | 967 EXPECT_EQ(kDefaultInitialWindow * kDefaultTCPMSS, |
970 client_sent_packet_manager.GetCongestionWindow()); | 968 client_sent_packet_manager.GetCongestionWindow()); |
971 EXPECT_EQ(kMaxInitialWindow * kDefaultTCPMSS, | 969 EXPECT_EQ(kMaxInitialWindow * kDefaultTCPMSS, |
972 server_sent_packet_manager.GetCongestionWindow()); | 970 server_sent_packet_manager.GetCongestionWindow()); |
973 | 971 |
974 EXPECT_EQ(GetParam().use_pacing, server_sent_packet_manager.using_pacing()); | 972 EXPECT_EQ(GetParam().use_pacing, server_sent_packet_manager.using_pacing()); |
975 EXPECT_EQ(GetParam().use_pacing, client_sent_packet_manager.using_pacing()); | 973 EXPECT_EQ(GetParam().use_pacing, client_sent_packet_manager.using_pacing()); |
976 | 974 |
977 EXPECT_EQ(100000u, | 975 // The client *should* set the intitial RTT. |
978 client_sent_packet_manager.GetRttStats()->initial_rtt_us()); | 976 EXPECT_EQ(1000u, client_sent_packet_manager.GetRttStats()->initial_rtt_us()); |
979 EXPECT_EQ(1u, server_sent_packet_manager.GetRttStats()->initial_rtt_us()); | 977 EXPECT_EQ(1000u, server_sent_packet_manager.GetRttStats()->initial_rtt_us()); |
980 | 978 |
981 // Now use the negotiated limits with packet loss. | 979 // Now use the negotiated limits with packet loss. |
982 SetPacketLossPercentage(30); | 980 SetPacketLossPercentage(30); |
983 | 981 |
984 // 10 KB body. | 982 // 10 KB body. |
985 string body; | 983 string body; |
986 GenerateBody(&body, 1024 * 10); | 984 GenerateBody(&body, 1024 * 10); |
987 | 985 |
988 HTTPMessage request(HttpConstants::HTTP_1_1, | 986 HTTPMessage request(HttpConstants::HTTP_1_1, |
989 HttpConstants::POST, "/foo"); | 987 HttpConstants::POST, "/foo"); |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1388 QuicSession* session = dispatcher->session_map().begin()->second; | 1386 QuicSession* session = dispatcher->session_map().begin()->second; |
1389 EXPECT_EQ(0u, QuicSessionPeer::GetLocallyClosedStreamsHighestOffset( | 1387 EXPECT_EQ(0u, QuicSessionPeer::GetLocallyClosedStreamsHighestOffset( |
1390 session).size()); | 1388 session).size()); |
1391 server_thread_->Resume(); | 1389 server_thread_->Resume(); |
1392 } | 1390 } |
1393 | 1391 |
1394 } // namespace | 1392 } // namespace |
1395 } // namespace test | 1393 } // namespace test |
1396 } // namespace tools | 1394 } // namespace tools |
1397 } // namespace net | 1395 } // namespace net |
OLD | NEW |