Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: net/quic/congestion_control/quic_congestion_manager_test.cc

Issue 15937012: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Small bug fixes Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/quic/congestion_control/quic_congestion_manager_test.cc
diff --git a/net/quic/congestion_control/quic_congestion_manager_test.cc b/net/quic/congestion_control/quic_congestion_manager_test.cc
index 8b8f47304fb32648a0f3c200bc06569063da0282..64aab9a490ea5a405913bc21a02264625943d339 100644
--- a/net/quic/congestion_control/quic_congestion_manager_test.cc
+++ b/net/quic/congestion_control/quic_congestion_manager_test.cc
@@ -4,6 +4,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "net/quic/congestion_control/inter_arrival_sender.h"
#include "net/quic/congestion_control/quic_congestion_manager.h"
#include "net/quic/quic_protocol.h"
#include "net/quic/test_tools/mock_clock.h"
@@ -28,8 +29,9 @@ class QuicCongestionManagerPeer : public QuicCongestionManager {
}
using QuicCongestionManager::rtt;
- using QuicCongestionManager::SentBandwidth;
-
+ const SendAlgorithmInterface::SentPacketsMap& packet_history_map() {
+ return packet_history_map_;
+ }
private:
DISALLOW_COPY_AND_ASSIGN(QuicCongestionManagerPeer);
};
@@ -69,7 +71,10 @@ TEST_F(QuicCongestionManagerTest, Bandwidth) {
}
EXPECT_EQ(100, manager_->BandwidthEstimate().ToKBytesPerSecond());
EXPECT_NEAR(100,
- manager_->SentBandwidth(clock_.Now()).ToKBytesPerSecond(), 4);
+ InterArrivalSender::CalculateSentBandwidth(
+ manager_->packet_history_map(),
+ clock_.Now()).ToKBytesPerSecond(),
+ 4);
}
TEST_F(QuicCongestionManagerTest, BandwidthWith1SecondGap) {
@@ -95,13 +100,21 @@ TEST_F(QuicCongestionManagerTest, BandwidthWith1SecondGap) {
}
EXPECT_EQ(100000, manager_->BandwidthEstimate().ToBytesPerSecond());
EXPECT_NEAR(100000,
- manager_->SentBandwidth(clock_.Now()).ToBytesPerSecond(), 2000);
+ InterArrivalSender::CalculateSentBandwidth(
+ manager_->packet_history_map(),
+ clock_.Now()).ToBytesPerSecond(),
+ 2000);
clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(500));
EXPECT_NEAR(50000,
- manager_->SentBandwidth(clock_.Now()).ToBytesPerSecond(), 1000);
+ InterArrivalSender::CalculateSentBandwidth(
+ manager_->packet_history_map(),
+ clock_.Now()).ToBytesPerSecond(),
+ 1000);
clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(501));
EXPECT_NEAR(100000, manager_->BandwidthEstimate().ToBytesPerSecond(), 2000);
- EXPECT_TRUE(manager_->SentBandwidth(clock_.Now()).IsZero());
+ EXPECT_TRUE(InterArrivalSender::CalculateSentBandwidth(
+ manager_->packet_history_map(),
+ clock_.Now()).IsZero());
for (int i = 1; i <= 150; ++i) {
EXPECT_TRUE(manager_->TimeUntilSend(
clock_.Now(), NOT_RETRANSMISSION, kIgnored).IsZero());
@@ -113,7 +126,10 @@ TEST_F(QuicCongestionManagerTest, BandwidthWith1SecondGap) {
}
EXPECT_EQ(100, manager_->BandwidthEstimate().ToKBytesPerSecond());
EXPECT_NEAR(100,
- manager_->SentBandwidth(clock_.Now()).ToKBytesPerSecond(), 2);
+ InterArrivalSender::CalculateSentBandwidth(
+ manager_->packet_history_map(),
+ clock_.Now()).ToKBytesPerSecond(),
+ 2);
}
TEST_F(QuicCongestionManagerTest, Rtt) {

Powered by Google App Engine
This is Rietveld 408576698