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

Unified Diff: webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc

Issue 2381833003: Change TWCC send interval to reduce overhead on low BW situations. (Closed)
Patch Set: Response to comments Created 4 years, 1 month 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/remote_estimator_proxy_unittest.cc
diff --git a/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc b/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc
index 9821568260c0cf82e0df7c97821409f162271246..33e1e2d3e79f0c5af722e384a01980e57ca3808a 100644
--- a/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc
+++ b/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy_unittest.cc
@@ -8,6 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
+#include <utility>
+
+#include "webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h"
#include "webrtc/modules/pacing/packet_router.h"
#include "webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h"
#include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
@@ -42,7 +46,7 @@ class RemoteEstimatorProxyTest : public ::testing::Test {
void Process() {
clock_.AdvanceTimeMilliseconds(
- RemoteEstimatorProxy::kDefaultProcessIntervalMs);
+ RemoteEstimatorProxy::kDefaultSendIntervalMs);
proxy_.Process();
}
@@ -350,4 +354,35 @@ TEST_F(RemoteEstimatorProxyTest, RemovesTimestampsOutOfScope) {
Process();
}
+TEST_F(RemoteEstimatorProxyTest, TimeUntilNextProcessIsZeroBeforeFirstProcess) {
+ EXPECT_EQ(0, proxy_.TimeUntilNextProcess());
+}
+
+TEST_F(RemoteEstimatorProxyTest, TimeUntilNextProcessIsDefaultOnUnkownBitrate) {
+ Process();
+ EXPECT_EQ(RemoteEstimatorProxy::kDefaultSendIntervalMs,
+ proxy_.TimeUntilNextProcess());
+}
+
+TEST_F(RemoteEstimatorProxyTest, TimeUntilNextProcessIsMinIntervalOn300kbps) {
+ Process();
+ proxy_.OnBitrateChanged(300000);
+ EXPECT_EQ(RemoteEstimatorProxy::kMinSendIntervalMs,
+ proxy_.TimeUntilNextProcess());
+}
+
+TEST_F(RemoteEstimatorProxyTest, TimeUntilNextProcessIsMaxIntervalOn20kbps) {
+ Process();
+ proxy_.OnBitrateChanged(20000);
+ EXPECT_EQ(RemoteEstimatorProxy::kMaxSendIntervalMs,
+ proxy_.TimeUntilNextProcess());
+}
+
+TEST_F(RemoteEstimatorProxyTest, TwccReportsUse5PercentOfAvailableBandwidth) {
+ Process();
+ proxy_.OnBitrateChanged(80000);
+ // 80kbps * 0.05 = TwccReportSize(68B * 8b/B) * 1000ms / SendInterval(136ms)
+ EXPECT_EQ(136, proxy_.TimeUntilNextProcess());
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698