| 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
|
|
|