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

Unified Diff: webrtc/video_engine/vie_remb_unittest.cc

Issue 1512853002: Nuke TickTime::UseFakeClock. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: feedback Created 5 years 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/video_engine/vie_remb.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video_engine/vie_remb_unittest.cc
diff --git a/webrtc/video_engine/vie_remb_unittest.cc b/webrtc/video_engine/vie_remb_unittest.cc
index f319d0d363ae50a04026cf5e22a7ba882fc5efd5..bde3274173cd557241b71dba92a2aa805fdda8c3 100644
--- a/webrtc/video_engine/vie_remb_unittest.cc
+++ b/webrtc/video_engine/vie_remb_unittest.cc
@@ -30,12 +30,15 @@ using ::testing::Return;
namespace webrtc {
class ViERembTest : public ::testing::Test {
+ public:
+ ViERembTest() : fake_clock_(12345) {}
+
protected:
virtual void SetUp() {
- TickTime::UseFakeClock(12345);
process_thread_.reset(new NiceMock<MockProcessThread>);
- vie_remb_.reset(new VieRemb());
+ vie_remb_.reset(new VieRemb(&fake_clock_));
}
+ SimulatedClock fake_clock_;
rtc::scoped_ptr<MockProcessThread> process_thread_;
rtc::scoped_ptr<VieRemb> vie_remb_;
};
@@ -51,7 +54,7 @@ TEST_F(ViERembTest, OneModuleTestForSendingRemb) {
vie_remb_->OnReceiveBitrateChanged(ssrcs, bitrate_estimate);
- TickTime::AdvanceFakeClock(1000);
+ fake_clock_.AdvanceTimeMilliseconds(1000);
EXPECT_CALL(rtp, SetREMBData(bitrate_estimate, ssrcs))
.Times(1);
vie_remb_->OnReceiveBitrateChanged(ssrcs, bitrate_estimate);
@@ -76,7 +79,7 @@ TEST_F(ViERembTest, LowerEstimateToSendRemb) {
vie_remb_->OnReceiveBitrateChanged(ssrcs, bitrate_estimate);
// Call OnReceiveBitrateChanged twice to get a first estimate.
- TickTime::AdvanceFakeClock(1000);
+ fake_clock_.AdvanceTimeMilliseconds(1000);
EXPECT_CALL(rtp, SetREMBData(bitrate_estimate, ssrcs))
.Times(1);
vie_remb_->OnReceiveBitrateChanged(ssrcs, bitrate_estimate);
@@ -105,7 +108,7 @@ TEST_F(ViERembTest, VerifyIncreasingAndDecreasing) {
// Call OnReceiveBitrateChanged twice to get a first estimate.
EXPECT_CALL(rtp_0, SetREMBData(bitrate_estimate[0], ssrcs))
.Times(1);
- TickTime::AdvanceFakeClock(1000);
+ fake_clock_.AdvanceTimeMilliseconds(1000);
vie_remb_->OnReceiveBitrateChanged(ssrcs, bitrate_estimate[0]);
vie_remb_->OnReceiveBitrateChanged(ssrcs, bitrate_estimate[1] + 100);
@@ -133,7 +136,7 @@ TEST_F(ViERembTest, NoRembForIncreasedBitrate) {
vie_remb_->OnReceiveBitrateChanged(ssrcs, bitrate_estimate);
// Call OnReceiveBitrateChanged twice to get a first estimate.
- TickTime::AdvanceFakeClock(1000);
+ fake_clock_.AdvanceTimeMilliseconds(1000);
EXPECT_CALL(rtp_0, SetREMBData(bitrate_estimate, ssrcs))
.Times(1);
vie_remb_->OnReceiveBitrateChanged(ssrcs, bitrate_estimate);
@@ -167,7 +170,7 @@ TEST_F(ViERembTest, ChangeSendRtpModule) {
vie_remb_->OnReceiveBitrateChanged(ssrcs, bitrate_estimate);
// Call OnReceiveBitrateChanged twice to get a first estimate.
- TickTime::AdvanceFakeClock(1000);
+ fake_clock_.AdvanceTimeMilliseconds(1000);
EXPECT_CALL(rtp_0, SetREMBData(bitrate_estimate, ssrcs))
.Times(1);
vie_remb_->OnReceiveBitrateChanged(ssrcs, bitrate_estimate);
@@ -203,7 +206,7 @@ TEST_F(ViERembTest, OnlyOneRembForDoubleProcess) {
vie_remb_->AddRembSender(&rtp);
vie_remb_->OnReceiveBitrateChanged(ssrcs, bitrate_estimate);
// Call OnReceiveBitrateChanged twice to get a first estimate.
- TickTime::AdvanceFakeClock(1000);
+ fake_clock_.AdvanceTimeMilliseconds(1000);
EXPECT_CALL(rtp, SetREMBData(_, _))
.Times(1);
vie_remb_->OnReceiveBitrateChanged(ssrcs, bitrate_estimate);
@@ -235,7 +238,7 @@ TEST_F(ViERembTest, NoSendingRtpModule) {
vie_remb_->OnReceiveBitrateChanged(ssrcs, bitrate_estimate);
// Call OnReceiveBitrateChanged twice to get a first estimate.
- TickTime::AdvanceFakeClock(1000);
+ fake_clock_.AdvanceTimeMilliseconds(1000);
EXPECT_CALL(rtp, SetREMBData(_, _))
.Times(1);
vie_remb_->OnReceiveBitrateChanged(ssrcs, bitrate_estimate);
« no previous file with comments | « webrtc/video_engine/vie_remb.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698