OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_connection.h" | 5 #include "net/quic/quic_connection.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 4051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4062 QuicPacketCreator* creator = | 4062 QuicPacketCreator* creator = |
4063 QuicConnectionPeer::GetPacketCreator(&connection_); | 4063 QuicConnectionPeer::GetPacketCreator(&connection_); |
4064 size_t max_packets_per_fec_group = creator->max_packets_per_fec_group(); | 4064 size_t max_packets_per_fec_group = creator->max_packets_per_fec_group(); |
4065 | 4065 |
4066 QuicSentPacketManager::NetworkChangeVisitor* visitor = | 4066 QuicSentPacketManager::NetworkChangeVisitor* visitor = |
4067 QuicSentPacketManagerPeer::GetNetworkChangeVisitor( | 4067 QuicSentPacketManagerPeer::GetNetworkChangeVisitor( |
4068 QuicConnectionPeer::GetSentPacketManager(&connection_)); | 4068 QuicConnectionPeer::GetSentPacketManager(&connection_)); |
4069 EXPECT_TRUE(visitor); | 4069 EXPECT_TRUE(visitor); |
4070 | 4070 |
4071 // Increase FEC group size by increasing congestion window to a large number. | 4071 // Increase FEC group size by increasing congestion window to a large number. |
4072 visitor->OnCongestionWindowChange(1000 * kDefaultTCPMSS); | 4072 EXPECT_CALL(*send_algorithm_, GetCongestionWindow()).WillRepeatedly( |
| 4073 Return(1000 * kDefaultTCPMSS)); |
| 4074 visitor->OnCongestionWindowChange(); |
4073 EXPECT_LT(max_packets_per_fec_group, creator->max_packets_per_fec_group()); | 4075 EXPECT_LT(max_packets_per_fec_group, creator->max_packets_per_fec_group()); |
4074 } | 4076 } |
4075 | 4077 |
4076 class MockQuicConnectionDebugVisitor | 4078 class MockQuicConnectionDebugVisitor |
4077 : public QuicConnectionDebugVisitor { | 4079 : public QuicConnectionDebugVisitor { |
4078 public: | 4080 public: |
4079 MOCK_METHOD1(OnFrameAddedToPacket, | 4081 MOCK_METHOD1(OnFrameAddedToPacket, |
4080 void(const QuicFrame&)); | 4082 void(const QuicFrame&)); |
4081 | 4083 |
4082 MOCK_METHOD6(OnPacketSent, | 4084 MOCK_METHOD6(OnPacketSent, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4164 QuicBlockedFrame blocked; | 4166 QuicBlockedFrame blocked; |
4165 blocked.stream_id = 3; | 4167 blocked.stream_id = 3; |
4166 EXPECT_CALL(visitor_, OnBlockedFrames(_)); | 4168 EXPECT_CALL(visitor_, OnBlockedFrames(_)); |
4167 ProcessFramePacket(QuicFrame(&blocked)); | 4169 ProcessFramePacket(QuicFrame(&blocked)); |
4168 EXPECT_TRUE(ack_alarm->IsSet()); | 4170 EXPECT_TRUE(ack_alarm->IsSet()); |
4169 } | 4171 } |
4170 | 4172 |
4171 } // namespace | 4173 } // namespace |
4172 } // namespace test | 4174 } // namespace test |
4173 } // namespace net | 4175 } // namespace net |
OLD | NEW |