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

Unified Diff: webrtc/modules/remote_bitrate_estimator/test/estimators/congestion_window_unittest.cc

Issue 2982233002: Added implementations for entering/exiting STARTUP, DRAIN, PROBE_BW, PROBE_RTT modes, also updated M (Closed)
Patch Set: Unittest fix Created 3 years, 5 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: webrtc/modules/remote_bitrate_estimator/test/estimators/congestion_window_unittest.cc
diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/congestion_window_unittest.cc b/webrtc/modules/remote_bitrate_estimator/test/estimators/congestion_window_unittest.cc
index bc0d370bca5dc9ecff8af60dcda9fe8c022d60a3..0c6d59cbc6a666a894897a058e1c562e38b39736 100644
--- a/webrtc/modules/remote_bitrate_estimator/test/estimators/congestion_window_unittest.cc
+++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/congestion_window_unittest.cc
@@ -19,7 +19,7 @@ namespace bwe {
namespace {
// These are the same values used in CongestionWindow class.
const int64_t kStartingCongestionWindow = 6000;
-const int64_t kMinimumCongestionWindow = 5840;
+const int64_t kMinimumCongestionWindow = 4000;
} // namespace
TEST(CongestionWindowTest, InitializationCheck) {
@@ -46,35 +46,38 @@ TEST(CongestionWindowTest, DataInflight) {
TEST(CongestionWindowTest, ZeroBandwidthDelayProduct) {
CongestionWindow congestion_window;
int64_t target_congestion_window =
- congestion_window.GetTargetCongestionWindow(100, 0, 2.885f);
+ congestion_window.GetTargetCongestionWindow(
+ 100, rtc::Optional<int64_t>(0), 2.885f);
EXPECT_EQ(target_congestion_window, 2.885f * kStartingCongestionWindow);
}
TEST(CongestionWindowTest, BelowMinimumTargetCongestionWindow) {
CongestionWindow congestion_window;
int64_t target_congestion_window =
- congestion_window.GetTargetCongestionWindow(100, 2, 2.885f);
+ congestion_window.GetTargetCongestionWindow(
+ 100, rtc::Optional<int64_t>(2), 2.885f);
EXPECT_EQ(target_congestion_window, kMinimumCongestionWindow);
}
TEST(CongestionWindowTest, AboveMinimumTargetCongestionWindow) {
CongestionWindow congestion_window;
int64_t target_congestion_window =
- congestion_window.GetTargetCongestionWindow(100000, 2, 2.885f);
+ congestion_window.GetTargetCongestionWindow(
+ 100000, rtc::Optional<int64_t>(2), 2.885f);
EXPECT_EQ(target_congestion_window, 577000);
}
TEST(CongestionWindowTest, MinimumCongestionWindow) {
CongestionWindow congestion_window;
- int64_t cwnd = congestion_window.GetCongestionWindow(BbrBweSender::PROBE_RTT,
- 100, 100, 2.885f);
+ int64_t cwnd = congestion_window.GetCongestionWindow(
+ BbrBweSender::PROBE_RTT, 100, rtc::Optional<int64_t>(100), 2.885f);
EXPECT_EQ(cwnd, kMinimumCongestionWindow);
}
TEST(CongestionWindowTest, CalculateCongestionWindow) {
CongestionWindow congestion_window;
- int64_t cwnd = congestion_window.GetCongestionWindow(BbrBweSender::STARTUP,
- 100, 100, 2.885f);
+ int64_t cwnd = congestion_window.GetCongestionWindow(
+ BbrBweSender::STARTUP, 100, rtc::Optional<int64_t>(100l), 2.885f);
EXPECT_EQ(cwnd, 28850);
}
} // namespace bwe

Powered by Google App Engine
This is Rietveld 408576698