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

Unified Diff: net/tools/quic/end_to_end_test.cc

Issue 351133002: Adds an internal server and chromium's flag for disabling/enabling FEC (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/reliable_quic_stream.h ('k') | net/tools/quic/quic_client_session_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/end_to_end_test.cc
diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
index 6f53359deb532db439c28a38ffed70acfdffc3cd..21351fe930eb4587cb88f86eba18dfbfcffa6dd9 100644
--- a/net/tools/quic/end_to_end_test.cc
+++ b/net/tools/quic/end_to_end_test.cc
@@ -668,7 +668,9 @@ TEST_P(EndToEndTest, DISABLED_LargePostZeroRTTFailure) {
VerifyCleanConnection(false);
}
-TEST_P(EndToEndTest, LargePostFEC) {
+TEST_P(EndToEndTest, LargePostFec) {
+ ValueRestore<bool> old_flag(&FLAGS_enable_quic_fec, true);
+
// Connect without packet loss to avoid issues with losing handshake packets,
// and then up the packet loss rate (b/10126687).
ASSERT_TRUE(Initialize());
@@ -677,10 +679,12 @@ TEST_P(EndToEndTest, LargePostFEC) {
client_->client()->WaitForCryptoHandshakeConfirmed();
SetPacketLossPercentage(30);
- // Enable FEC protection.
+ // Verify that FEC is enabled.
QuicPacketCreator* creator = QuicConnectionPeer::GetPacketCreator(
client_->client()->session()->connection());
- creator->set_max_packets_per_fec_group(3);
+ EXPECT_TRUE(creator->IsFecEnabled());
+ EXPECT_EQ(kMaxPacketsPerFecGroup, creator->max_packets_per_fec_group());
+
// Set FecPolicy to always protect data on all streams.
client_->SetFecPolicy(FEC_PROTECT_ALWAYS);
@@ -694,6 +698,43 @@ TEST_P(EndToEndTest, LargePostFEC) {
VerifyCleanConnection(true);
}
+TEST_P(EndToEndTest, ClientSpecifiedFecProtectionForHeaders) {
+ ValueRestore<bool> old_flag(&FLAGS_enable_quic_fec, true);
+
+ // Set FEC config in client's connection options and in client session.
+ QuicTagVector copt;
+ copt.push_back(kFHDR);
+ client_config_.SetConnectionOptionsToSend(copt);
+
+ // Connect without packet loss to avoid issues with losing handshake packets,
+ // and then up the packet loss rate (b/10126687).
+ ASSERT_TRUE(Initialize());
+ client_->client()->WaitForCryptoHandshakeConfirmed();
+ server_thread_->WaitForCryptoHandshakeConfirmed();
+
+ // Verify that FEC is enabled.
+ QuicPacketCreator* creator = QuicConnectionPeer::GetPacketCreator(
+ client_->client()->session()->connection());
+ EXPECT_TRUE(creator->IsFecEnabled());
+ EXPECT_EQ(kMaxPacketsPerFecGroup, creator->max_packets_per_fec_group());
+
+ // Verify that server headers stream is FEC protected.
+ server_thread_->Pause();
+ QuicDispatcher* dispatcher =
+ QuicServerPeer::GetDispatcher(server_thread_->server());
+ ASSERT_EQ(1u, dispatcher->session_map().size());
+ QuicSession* session = dispatcher->session_map().begin()->second;
+ EXPECT_EQ(FEC_PROTECT_ALWAYS,
+ QuicSessionPeer::GetHeadersStream(session)->fec_policy());
+ server_thread_->Resume();
+
+ // Verify that at the client, headers stream is protected and other data
+ // streams are optionally protected.
+ EXPECT_EQ(FEC_PROTECT_ALWAYS, QuicSessionPeer::GetHeadersStream(
+ client_->client()->session())->fec_policy());
+ EXPECT_EQ(FEC_PROTECT_OPTIONAL, client_->GetOrCreateStream()->fec_policy());
+}
+
// TODO(shess): This is flaky on ChromiumOS bots.
// http://crbug.com/374871
TEST_P(EndToEndTest, DISABLED_LargePostSmallBandwidthLargeBuffer) {
« no previous file with comments | « net/quic/reliable_quic_stream.h ('k') | net/tools/quic/quic_client_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698