Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / net / quic / congestion_control / tcp_cubic_sender_test.cc
index cc52da6..f6afdc8 100644 (file)
@@ -15,6 +15,7 @@
 #include "net/quic/test_tools/quic_config_peer.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using std::make_pair;
 using std::min;
 
 namespace net {
@@ -86,11 +87,12 @@ class TcpCubicSenderTest : public ::testing::Test {
     sender_->rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(60),
                                   QuicTime::Delta::Zero(),
                                   clock_.Now());
-    SendAlgorithmInterface::CongestionMap acked_packets;
-    SendAlgorithmInterface::CongestionMap lost_packets;
+    SendAlgorithmInterface::CongestionVector acked_packets;
+    SendAlgorithmInterface::CongestionVector lost_packets;
     for (int i = 0; i < n; ++i) {
       ++acked_sequence_number_;
-      acked_packets[acked_sequence_number_] = standard_packet_;
+      acked_packets.push_back(
+          make_pair(acked_sequence_number_, standard_packet_));
     }
     sender_->OnCongestionEvent(
         true, bytes_in_flight_, acked_packets, lost_packets);
@@ -99,11 +101,12 @@ class TcpCubicSenderTest : public ::testing::Test {
   }
 
   void LoseNPackets(int n) {
-    SendAlgorithmInterface::CongestionMap acked_packets;
-    SendAlgorithmInterface::CongestionMap lost_packets;
+    SendAlgorithmInterface::CongestionVector acked_packets;
+    SendAlgorithmInterface::CongestionVector lost_packets;
     for (int i = 0; i < n; ++i) {
       ++acked_sequence_number_;
-      lost_packets[acked_sequence_number_] = standard_packet_;
+      lost_packets.push_back(
+          make_pair(acked_sequence_number_, standard_packet_));
     }
     sender_->OnCongestionEvent(
         false, bytes_in_flight_, acked_packets, lost_packets);
@@ -112,9 +115,10 @@ class TcpCubicSenderTest : public ::testing::Test {
 
   // Does not increment acked_sequence_number_.
   void LosePacket(QuicPacketSequenceNumber sequence_number) {
-    SendAlgorithmInterface::CongestionMap acked_packets;
-    SendAlgorithmInterface::CongestionMap lost_packets;
-    lost_packets[sequence_number] = standard_packet_;
+    SendAlgorithmInterface::CongestionVector acked_packets;
+    SendAlgorithmInterface::CongestionVector lost_packets;
+    lost_packets.push_back(
+        make_pair(sequence_number, standard_packet_));
     sender_->OnCongestionEvent(
         false, bytes_in_flight_, acked_packets, lost_packets);
     bytes_in_flight_ -= kDefaultTCPMSS;