Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: net/tools/quic/end_to_end_test.cc

Issue 338623002: Added FEC policy per stream, which is translated to an FEC protection (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 // DFATAL when they are serialized after the downgrade. 629 // DFATAL when they are serialized after the downgrade.
630 client_->client()->WaitForCryptoHandshakeConfirmed(); 630 client_->client()->WaitForCryptoHandshakeConfirmed();
631 } 631 }
632 ASSERT_TRUE(client_->client()->connected()); 632 ASSERT_TRUE(client_->client()->connected());
633 EXPECT_EQ(kFooResponseBody, client_->SendCustomSynchronousRequest(request)); 633 EXPECT_EQ(kFooResponseBody, client_->SendCustomSynchronousRequest(request));
634 EXPECT_EQ(2, client_->client()->session()->GetNumSentClientHellos()); 634 EXPECT_EQ(2, client_->client()->session()->GetNumSentClientHellos());
635 VerifyCleanConnection(false); 635 VerifyCleanConnection(false);
636 } 636 }
637 637
638 TEST_P(EndToEndTest, LargePostFEC) { 638 TEST_P(EndToEndTest, LargePostFEC) {
639 // TODO(jri): Set FecPolicy to always protect on client_->stream_.
640 // This test currently does not do any FEC protection.
641
642 // Connect without packet loss to avoid issues with losing handshake packets, 639 // Connect without packet loss to avoid issues with losing handshake packets,
643 // and then up the packet loss rate (b/10126687). 640 // and then up the packet loss rate (b/10126687).
644 ASSERT_TRUE(Initialize()); 641 ASSERT_TRUE(Initialize());
645 642
646 // Wait for the server SHLO before upping the packet loss. 643 // Wait for the server SHLO before upping the packet loss.
647 client_->client()->WaitForCryptoHandshakeConfirmed(); 644 client_->client()->WaitForCryptoHandshakeConfirmed();
648 SetPacketLossPercentage(30); 645 SetPacketLossPercentage(30);
649 646
650 // Enable FEC protection. 647 // Enable FEC protection.
651 QuicPacketCreator* creator = QuicConnectionPeer::GetPacketCreator( 648 QuicPacketCreator* creator = QuicConnectionPeer::GetPacketCreator(
652 client_->client()->session()->connection()); 649 client_->client()->session()->connection());
653 creator->set_max_packets_per_fec_group(6); 650 creator->set_max_packets_per_fec_group(3);
651 // Set FecPolicy to always protect data on all streams.
652 client_->SetFecPolicy(PROTECT_ALWAYS);
654 653
655 string body; 654 string body;
656 GenerateBody(&body, 10240); 655 GenerateBody(&body, 10240);
657 656
658 HTTPMessage request(HttpConstants::HTTP_1_1, 657 HTTPMessage request(HttpConstants::HTTP_1_1,
659 HttpConstants::POST, "/foo"); 658 HttpConstants::POST, "/foo");
660 request.AddBody(body, true); 659 request.AddBody(body, true);
661 EXPECT_EQ(kFooResponseBody, client_->SendCustomSynchronousRequest(request)); 660 EXPECT_EQ(kFooResponseBody, client_->SendCustomSynchronousRequest(request));
662 VerifyCleanConnection(true); 661 VerifyCleanConnection(true);
663 } 662 }
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 QuicSession* session = dispatcher->session_map().begin()->second; 1133 QuicSession* session = dispatcher->session_map().begin()->second;
1135 EXPECT_EQ(kClientIFCW, 1134 EXPECT_EQ(kClientIFCW,
1136 session->config()->ReceivedInitialFlowControlWindowBytes()); 1135 session->config()->ReceivedInitialFlowControlWindowBytes());
1137 server_thread_->Resume(); 1136 server_thread_->Resume();
1138 } 1137 }
1139 1138
1140 } // namespace 1139 } // namespace
1141 } // namespace test 1140 } // namespace test
1142 } // namespace tools 1141 } // namespace tools
1143 } // namespace net 1142 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/reliable_quic_stream_peer.cc ('k') | net/tools/quic/test_tools/quic_test_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698