Index: net/quic/test_tools/quic_connection_peer.cc |
diff --git a/net/quic/test_tools/quic_connection_peer.cc b/net/quic/test_tools/quic_connection_peer.cc |
index c9a8901b67e02f89902658013a8f40654ffed4ac..61e948dde35142fd33695a54277c3a6990dce8d2 100644 |
--- a/net/quic/test_tools/quic_connection_peer.cc |
+++ b/net/quic/test_tools/quic_connection_peer.cc |
@@ -6,6 +6,7 @@ |
#include "base/stl_util.h" |
#include "net/quic/congestion_control/send_algorithm_interface.h" |
+#include "net/quic/quic_multipath_sent_packet_manager.h" |
#include "net/quic/quic_packet_writer.h" |
#include "net/quic/quic_received_packet_manager.h" |
#include "net/quic/test_tools/quic_framer_peer.h" |
@@ -23,13 +24,22 @@ void QuicConnectionPeer::SendAck(QuicConnection* connection) { |
// static |
void QuicConnectionPeer::SetSendAlgorithm( |
QuicConnection* connection, |
+ QuicPathId path_id, |
SendAlgorithmInterface* send_algorithm) { |
- // TODO(fayang): Remove this method when there is a MockSentPacketManager. |
- static_cast<QuicSentPacketManager*>(connection->sent_packet_manager_.get()) |
+ GetSentPacketManager(connection, path_id) |
->send_algorithm_.reset(send_algorithm); |
} |
// static |
+void QuicConnectionPeer::SetLossAlgorithm( |
+ QuicConnection* connection, |
+ QuicPathId path_id, |
+ LossDetectionInterface* loss_algorithm) { |
+ GetSentPacketManager(connection, path_id) |
+ ->loss_algorithm_.reset(loss_algorithm); |
+} |
+ |
+// static |
const QuicFrame QuicConnectionPeer::GetUpdatedAckFrame( |
QuicConnection* connection) { |
return connection->GetUpdatedAckFrame(); |
@@ -63,8 +73,14 @@ QuicPacketGenerator* QuicConnectionPeer::GetPacketGenerator( |
// static |
QuicSentPacketManager* QuicConnectionPeer::GetSentPacketManager( |
- QuicConnection* connection) { |
- // TODO(fayang): Remove this method when there is a MockSentPacketManager. |
+ QuicConnection* connection, |
+ QuicPathId path_id) { |
+ if (FLAGS_quic_enable_multipath) { |
+ return static_cast<QuicSentPacketManager*>( |
+ static_cast<QuicMultipathSentPacketManager*>( |
+ connection->sent_packet_manager_.get()) |
+ ->MaybeGetSentPacketManagerForPath(path_id)); |
+ } |
return static_cast<QuicSentPacketManager*>( |
connection->sent_packet_manager_.get()); |
} |