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 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1465 #if 0 | 1465 #if 0 |
1466 options.clear(); | 1466 options.clear(); |
1467 options.push_back(kTBBR); | 1467 options.push_back(kTBBR); |
1468 QuicConfigPeer::SetReceivedConnectionOptions(&config, options); | 1468 QuicConfigPeer::SetReceivedConnectionOptions(&config, options); |
1469 EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange()); | 1469 EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange()); |
1470 EXPECT_CALL(*network_change_visitor_, OnRttChange()); | 1470 EXPECT_CALL(*network_change_visitor_, OnRttChange()); |
1471 manager_.SetFromConfig(config); | 1471 manager_.SetFromConfig(config); |
1472 EXPECT_EQ(kBBR, QuicSentPacketManagerPeer::GetSendAlgorithm( | 1472 EXPECT_EQ(kBBR, QuicSentPacketManagerPeer::GetSendAlgorithm( |
1473 manager_)->GetCongestionControlType()); | 1473 manager_)->GetCongestionControlType()); |
1474 #endif | 1474 #endif |
| 1475 |
| 1476 options.clear(); |
| 1477 options.push_back(kBYTE); |
| 1478 QuicConfigPeer::SetReceivedConnectionOptions(&config, options); |
| 1479 EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange()); |
| 1480 EXPECT_CALL(*network_change_visitor_, OnRttChange()); |
| 1481 manager_.SetFromConfig(config); |
| 1482 EXPECT_EQ(kCubicBytes, QuicSentPacketManagerPeer::GetSendAlgorithm(manager_) |
| 1483 ->GetCongestionControlType()); |
| 1484 |
| 1485 options.clear(); |
| 1486 options.push_back(kRENO); |
| 1487 options.push_back(kBYTE); |
| 1488 QuicConfigPeer::SetReceivedConnectionOptions(&config, options); |
| 1489 EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange()); |
| 1490 EXPECT_CALL(*network_change_visitor_, OnRttChange()); |
| 1491 manager_.SetFromConfig(config); |
| 1492 EXPECT_EQ(kRenoBytes, QuicSentPacketManagerPeer::GetSendAlgorithm(manager_) |
| 1493 ->GetCongestionControlType()); |
1475 } | 1494 } |
1476 | 1495 |
1477 TEST_F(QuicSentPacketManagerTest, NegotiateNumConnectionsFromOptions) { | 1496 TEST_F(QuicSentPacketManagerTest, NegotiateNumConnectionsFromOptions) { |
1478 QuicConfig config; | 1497 QuicConfig config; |
1479 QuicTagVector options; | 1498 QuicTagVector options; |
1480 | 1499 |
1481 options.push_back(k1CON); | 1500 options.push_back(k1CON); |
1482 QuicConfigPeer::SetReceivedConnectionOptions(&config, options); | 1501 QuicConfigPeer::SetReceivedConnectionOptions(&config, options); |
1483 EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange()); | 1502 EXPECT_CALL(*network_change_visitor_, OnCongestionWindowChange()); |
1484 EXPECT_CALL(*network_change_visitor_, OnRttChange()); | 1503 EXPECT_CALL(*network_change_visitor_, OnRttChange()); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1665 | 1684 |
1666 EXPECT_CALL(*send_algorithm_, ResumeConnectionState(_)); | 1685 EXPECT_CALL(*send_algorithm_, ResumeConnectionState(_)); |
1667 manager_.ResumeConnectionState(cached_network_params); | 1686 manager_.ResumeConnectionState(cached_network_params); |
1668 EXPECT_EQ(kRttMs * kNumMicrosPerMilli, | 1687 EXPECT_EQ(kRttMs * kNumMicrosPerMilli, |
1669 static_cast<uint64>(manager_.GetRttStats()->initial_rtt_us())); | 1688 static_cast<uint64>(manager_.GetRttStats()->initial_rtt_us())); |
1670 } | 1689 } |
1671 | 1690 |
1672 } // namespace | 1691 } // namespace |
1673 } // namespace test | 1692 } // namespace test |
1674 } // namespace net | 1693 } // namespace net |
OLD | NEW |