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

Unified Diff: net/tools/quic/quic_client_session_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/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_server_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_client_session_test.cc
diff --git a/net/tools/quic/quic_client_session_test.cc b/net/tools/quic/quic_client_session_test.cc
index 7b50f42ab39c518c19e0fb7d022649217e9d0465..dc6b244c2eabd16033bad43ce037a4dba1084829 100644
--- a/net/tools/quic/quic_client_session_test.cc
+++ b/net/tools/quic/quic_client_session_test.cc
@@ -8,7 +8,9 @@
#include "net/base/ip_endpoint.h"
#include "net/quic/crypto/aes_128_gcm_12_encrypter.h"
+#include "net/quic/quic_flags.h"
#include "net/quic/test_tools/crypto_test_utils.h"
+#include "net/quic/test_tools/quic_session_peer.h"
#include "net/quic/test_tools/quic_test_utils.h"
#include "net/tools/quic/quic_spdy_client_stream.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -16,7 +18,9 @@
using net::test::CryptoTestUtils;
using net::test::DefaultQuicConfig;
using net::test::PacketSavingConnection;
+using net::test::QuicSessionPeer;
using net::test::SupportedVersions;
+using net::test::ValueRestore;
using testing::_;
namespace net {
@@ -86,6 +90,26 @@ TEST_P(ToolsQuicClientSessionTest, GoAwayReceived) {
EXPECT_EQ(NULL, session_->CreateOutgoingDataStream());
}
+TEST_P(ToolsQuicClientSessionTest, SetFecProtectionFromConfig) {
+ ValueRestore<bool> old_flag(&FLAGS_enable_quic_fec, true);
+
+ // Set FEC config in client's connection options.
+ QuicTagVector copt;
+ copt.push_back(kFHDR);
+ session_->config()->SetConnectionOptionsToSend(copt);
+
+ // Doing the handshake should set up FEC config correctly.
+ CompleteCryptoHandshake();
+
+ // Verify that headers stream is always protected and data streams are
+ // optionally protected.
+ EXPECT_EQ(FEC_PROTECT_ALWAYS,
+ QuicSessionPeer::GetHeadersStream(session_.get())->fec_policy());
+ QuicSpdyClientStream* stream = session_->CreateOutgoingDataStream();
+ ASSERT_TRUE(stream);
+ EXPECT_EQ(FEC_PROTECT_OPTIONAL, stream->fec_policy());
+}
+
} // namespace
} // namespace test
} // namespace tools
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_server_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698