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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 ASSERT_TRUE(Initialize()); | 676 ASSERT_TRUE(Initialize()); |
677 | 677 |
678 // Wait for the server SHLO before upping the packet loss. | 678 // Wait for the server SHLO before upping the packet loss. |
679 client_->client()->WaitForCryptoHandshakeConfirmed(); | 679 client_->client()->WaitForCryptoHandshakeConfirmed(); |
680 SetPacketLossPercentage(30); | 680 SetPacketLossPercentage(30); |
681 | 681 |
682 // Verify that FEC is enabled. | 682 // Verify that FEC is enabled. |
683 QuicPacketCreator* creator = QuicConnectionPeer::GetPacketCreator( | 683 QuicPacketCreator* creator = QuicConnectionPeer::GetPacketCreator( |
684 client_->client()->session()->connection()); | 684 client_->client()->session()->connection()); |
685 EXPECT_TRUE(creator->IsFecEnabled()); | 685 EXPECT_TRUE(creator->IsFecEnabled()); |
686 EXPECT_EQ(kMaxPacketsPerFecGroup, creator->max_packets_per_fec_group()); | |
687 | 686 |
688 // Set FecPolicy to always protect data on all streams. | 687 // Set FecPolicy to always protect data on all streams. |
689 client_->SetFecPolicy(FEC_PROTECT_ALWAYS); | 688 client_->SetFecPolicy(FEC_PROTECT_ALWAYS); |
690 | 689 |
691 string body; | 690 string body; |
692 GenerateBody(&body, 10240); | 691 GenerateBody(&body, 10240); |
693 | 692 |
694 HTTPMessage request(HttpConstants::HTTP_1_1, | 693 HTTPMessage request(HttpConstants::HTTP_1_1, |
695 HttpConstants::POST, "/foo"); | 694 HttpConstants::POST, "/foo"); |
696 request.AddBody(body, true); | 695 request.AddBody(body, true); |
(...skipping 12 matching lines...) Expand all Loading... |
709 // Connect without packet loss to avoid issues with losing handshake packets, | 708 // Connect without packet loss to avoid issues with losing handshake packets, |
710 // and then up the packet loss rate (b/10126687). | 709 // and then up the packet loss rate (b/10126687). |
711 ASSERT_TRUE(Initialize()); | 710 ASSERT_TRUE(Initialize()); |
712 client_->client()->WaitForCryptoHandshakeConfirmed(); | 711 client_->client()->WaitForCryptoHandshakeConfirmed(); |
713 server_thread_->WaitForCryptoHandshakeConfirmed(); | 712 server_thread_->WaitForCryptoHandshakeConfirmed(); |
714 | 713 |
715 // Verify that FEC is enabled. | 714 // Verify that FEC is enabled. |
716 QuicPacketCreator* creator = QuicConnectionPeer::GetPacketCreator( | 715 QuicPacketCreator* creator = QuicConnectionPeer::GetPacketCreator( |
717 client_->client()->session()->connection()); | 716 client_->client()->session()->connection()); |
718 EXPECT_TRUE(creator->IsFecEnabled()); | 717 EXPECT_TRUE(creator->IsFecEnabled()); |
719 EXPECT_EQ(kMaxPacketsPerFecGroup, creator->max_packets_per_fec_group()); | |
720 | 718 |
721 // Verify that server headers stream is FEC protected. | 719 // Verify that server headers stream is FEC protected. |
722 server_thread_->Pause(); | 720 server_thread_->Pause(); |
723 QuicDispatcher* dispatcher = | 721 QuicDispatcher* dispatcher = |
724 QuicServerPeer::GetDispatcher(server_thread_->server()); | 722 QuicServerPeer::GetDispatcher(server_thread_->server()); |
725 ASSERT_EQ(1u, dispatcher->session_map().size()); | 723 ASSERT_EQ(1u, dispatcher->session_map().size()); |
726 QuicSession* session = dispatcher->session_map().begin()->second; | 724 QuicSession* session = dispatcher->session_map().begin()->second; |
727 EXPECT_EQ(FEC_PROTECT_ALWAYS, | 725 EXPECT_EQ(FEC_PROTECT_ALWAYS, |
728 QuicSessionPeer::GetHeadersStream(session)->fec_policy()); | 726 QuicSessionPeer::GetHeadersStream(session)->fec_policy()); |
729 server_thread_->Resume(); | 727 server_thread_->Resume(); |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 session->flow_controller(); | 1324 session->flow_controller(); |
1327 EXPECT_EQ(kSessionIFCW, QuicFlowControllerPeer::ReceiveWindowSize( | 1325 EXPECT_EQ(kSessionIFCW, QuicFlowControllerPeer::ReceiveWindowSize( |
1328 server_connection_flow_controller)); | 1326 server_connection_flow_controller)); |
1329 server_thread_->Resume(); | 1327 server_thread_->Resume(); |
1330 } | 1328 } |
1331 | 1329 |
1332 } // namespace | 1330 } // namespace |
1333 } // namespace test | 1331 } // namespace test |
1334 } // namespace tools | 1332 } // namespace tools |
1335 } // namespace net | 1333 } // namespace net |
OLD | NEW |