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

Unified Diff: webrtc/modules/congestion_controller/congestion_controller_unittest.cc

Issue 2279283002: Do not report bucket delay when pacer is paused. (Closed)
Patch Set: Created 4 years, 4 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
« no previous file with comments | « webrtc/modules/congestion_controller/congestion_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/congestion_controller/congestion_controller_unittest.cc
diff --git a/webrtc/modules/congestion_controller/congestion_controller_unittest.cc b/webrtc/modules/congestion_controller/congestion_controller_unittest.cc
index ce2258bf5e0a37ad5d2850d4039e063ea0482c2e..53ccf3dda1d21c1c8f16be14522348181b4bf9b0 100644
--- a/webrtc/modules/congestion_controller/congestion_controller_unittest.cc
+++ b/webrtc/modules/congestion_controller/congestion_controller_unittest.cc
@@ -18,6 +18,7 @@
#include "webrtc/system_wrappers/include/clock.h"
using testing::_;
+using testing::AtLeast;
using testing::NiceMock;
using testing::Return;
using testing::SaveArg;
@@ -169,5 +170,21 @@ TEST_F(CongestionControllerTest,
controller_->Process();
}
+TEST_F(CongestionControllerTest, GetPacerQueuingDelayMs) {
+ EXPECT_CALL(observer_, OnNetworkChanged(_, _, _)).Times(AtLeast(1));
+
+ const int64_t kQueueTimeMs = 123;
+ EXPECT_CALL(*pacer_, QueueInMs()).WillRepeatedly(Return(kQueueTimeMs));
+ EXPECT_EQ(kQueueTimeMs, controller_->GetPacerQueuingDelayMs());
+
+ // Expect zero pacer delay when network is down.
+ controller_->SignalNetworkState(kNetworkDown);
+ EXPECT_EQ(0, controller_->GetPacerQueuingDelayMs());
+
+ // Network is up, pacer delay should be reported.
+ controller_->SignalNetworkState(kNetworkUp);
+ EXPECT_EQ(kQueueTimeMs, controller_->GetPacerQueuingDelayMs());
+}
+
} // namespace test
} // namespace webrtc
« no previous file with comments | « webrtc/modules/congestion_controller/congestion_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698