OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "net/quic/quic_sent_packet_manager.h" | 5 #include "net/quic/quic_sent_packet_manager.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "net/quic/quic_flags.h" | 8 #include "net/quic/quic_flags.h" |
9 #include "net/quic/test_tools/quic_config_peer.h" | 9 #include "net/quic/test_tools/quic_config_peer.h" |
10 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" | 10 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" |
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1443 QuicConfigPeer::SetReceivedConnectionOptions(&config, options); | 1443 QuicConfigPeer::SetReceivedConnectionOptions(&config, options); |
1444 EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange(_)); | 1444 EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange(_)); |
1445 EXPECT_CALL(*send_algorithm_, GetCongestionWindow()) | 1445 EXPECT_CALL(*send_algorithm_, GetCongestionWindow()) |
1446 .WillOnce(Return(100 * kDefaultTCPMSS)); | 1446 .WillOnce(Return(100 * kDefaultTCPMSS)); |
1447 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)); | 1447 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)); |
1448 manager_.SetFromConfig(config); | 1448 manager_.SetFromConfig(config); |
1449 | 1449 |
1450 EXPECT_TRUE(manager_.using_pacing()); | 1450 EXPECT_TRUE(manager_.using_pacing()); |
1451 } | 1451 } |
1452 | 1452 |
| 1453 TEST_F(QuicSentPacketManagerTest, UseInitialRoundTripTimeToSend) { |
| 1454 uint32 initial_rtt_us = 325000; |
| 1455 EXPECT_NE(initial_rtt_us, |
| 1456 manager_.GetRttStats()->SmoothedRtt().ToMicroseconds()); |
| 1457 |
| 1458 QuicConfig config; |
| 1459 config.SetInitialRoundTripTimeUsToSend(initial_rtt_us); |
| 1460 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)); |
| 1461 EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange(_)); |
| 1462 EXPECT_CALL(*send_algorithm_, GetCongestionWindow()) |
| 1463 .WillOnce(Return(100 * kDefaultTCPMSS)); |
| 1464 manager_.SetFromConfig(config); |
| 1465 |
| 1466 EXPECT_EQ(initial_rtt_us, |
| 1467 manager_.GetRttStats()->SmoothedRtt().ToMicroseconds()); |
| 1468 } |
| 1469 |
1453 } // namespace | 1470 } // namespace |
1454 } // namespace test | 1471 } // namespace test |
1455 } // namespace net | 1472 } // namespace net |
OLD | NEW |