From 2bd8d62d3b2e4a87301b4f8b009e50ad914c12ad Mon Sep 17 00:00:00 2001 From: "hta@webrtc.org" Date: Thu, 21 Jun 2012 09:57:24 +0000 Subject: [PATCH] Sleep using no compile flags BUG=603 TEST= Review URL: https://webrtc-codereview.appspot.com/665004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2432 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/video_engine/vie_remb_unittest.cc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/video_engine/vie_remb_unittest.cc b/src/video_engine/vie_remb_unittest.cc index f8030fa56..83723af63 100644 --- a/src/video_engine/vie_remb_unittest.cc +++ b/src/video_engine/vie_remb_unittest.cc @@ -13,14 +13,12 @@ #include #include -#if defined(_WIN32) -#include -#endif #include "modules/rtp_rtcp/interface/rtp_rtcp.h" #include "modules/rtp_rtcp/mocks/mock_rtp_rtcp.h" #include "modules/utility/interface/process_thread.h" #include "system_wrappers/interface/scoped_ptr.h" +#include "system_wrappers/interface/sleep.h" #include "video_engine/vie_remb.h" using ::testing::_; @@ -49,14 +47,6 @@ class ViERembTest : public ::testing::Test { } scoped_ptr process_thread_; scoped_ptr vie_remb_; - - void TestSleep(unsigned int time_ms) { -#if defined(_WIN32) - ::Sleep(time_ms); -#else - usleep(time_ms * 1000); -#endif - } }; TEST_F(ViERembTest, OneModuleTestForSendingRemb) @@ -73,7 +63,7 @@ TEST_F(ViERembTest, OneModuleTestForSendingRemb) .WillRepeatedly(Return(ssrc[0])); // TODO(mflodman) Add fake clock and remove the lowered bitrate below. - TestSleep(1010); + SleepMs(1010); EXPECT_CALL(rtp, SetREMBData(bitrate_estimate, 1, _)) .Times(1); vie_remb_->Process(); @@ -166,7 +156,7 @@ TEST_F(ViERembTest, NoRembForIncreasedBitrate) // Trigger a first call to have a running state. // TODO(mflodman) Add fake clock. - TestSleep(1010); + SleepMs(1010); EXPECT_CALL(rtp_0, SetREMBData(bitrate_estimate[0] + bitrate_estimate[1], 2, _)) .Times(1); @@ -271,7 +261,7 @@ TEST_F(ViERembTest, NoOnReceivedBitrateChangedCall) vie_remb_->AddReceiveChannel(&rtp); vie_remb_->AddRembSender(&rtp); // TODO(mflodman) Add fake clock. - TestSleep(1010); + SleepMs(1010); // No bitrate estimate given, no callback expected. EXPECT_CALL(rtp, SetREMBData(_, _, _)) .Times(0);