| Index: net/quic/quic_sent_packet_manager_test.cc
|
| diff --git a/net/quic/quic_sent_packet_manager_test.cc b/net/quic/quic_sent_packet_manager_test.cc
|
| index 28f433216d97a222eeec7015a2dc578e54a949f7..d93d39afb4500310c541a4ffb0a840fa3e621c72 100644
|
| --- a/net/quic/quic_sent_packet_manager_test.cc
|
| +++ b/net/quic/quic_sent_packet_manager_test.cc
|
| @@ -5,6 +5,7 @@
|
| #include "net/quic/quic_sent_packet_manager.h"
|
|
|
| #include "base/stl_util.h"
|
| +#include "net/quic/quic_flags.h"
|
| #include "net/quic/test_tools/quic_config_peer.h"
|
| #include "net/quic/test_tools/quic_sent_packet_manager_peer.h"
|
| #include "net/quic/test_tools/quic_test_utils.h"
|
| @@ -1321,6 +1322,36 @@ TEST_F(QuicSentPacketManagerTest, NegotiateTimeLossDetection) {
|
| &manager_)->GetLossDetectionType());
|
| }
|
|
|
| +TEST_F(QuicSentPacketManagerTest, NegotiateTimeLossDetectionFromOptions) {
|
| + EXPECT_EQ(kNack,
|
| + QuicSentPacketManagerPeer::GetLossAlgorithm(
|
| + &manager_)->GetLossDetectionType());
|
| +
|
| + QuicConfig config;
|
| + QuicTagVector options;
|
| + options.push_back(kTIME);
|
| + QuicConfigPeer::SetReceivedCongestionOptions(&config, options);
|
| + EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
|
| + manager_.SetFromConfig(config);
|
| +
|
| + EXPECT_EQ(kTime,
|
| + QuicSentPacketManagerPeer::GetLossAlgorithm(
|
| + &manager_)->GetLossDetectionType());
|
| +}
|
| +
|
| +TEST_F(QuicSentPacketManagerTest, NegotiatePacingFromOptions) {
|
| + ValueRestore<bool> old_flag(&FLAGS_enable_quic_pacing, true);
|
| + EXPECT_FALSE(manager_.using_pacing());
|
| +
|
| + QuicConfig config;
|
| + QuicTagVector options;
|
| + options.push_back(kPACE);
|
| + QuicConfigPeer::SetReceivedCongestionOptions(&config, options);
|
| + EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
|
| + manager_.SetFromConfig(config);
|
| +
|
| + EXPECT_TRUE(manager_.using_pacing());
|
| +}
|
|
|
| } // namespace
|
| } // namespace test
|
|
|