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

Unified Diff: webrtc/modules/video_coding/utility/simulcast_rate_allocator_unittest.cc

Issue 2529073003: Fix perf regression in screenshare temporal layer bitrate allocation (Closed)
Patch Set: Yet another failing test 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
« no previous file with comments | « webrtc/modules/video_coding/utility/simulcast_rate_allocator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/utility/simulcast_rate_allocator_unittest.cc
diff --git a/webrtc/modules/video_coding/utility/simulcast_rate_allocator_unittest.cc b/webrtc/modules/video_coding/utility/simulcast_rate_allocator_unittest.cc
index f87c717681a64154816fa271698e357eef0d5bd9..b635ec250043c819f421b334d49d0b0c203bb103 100644
--- a/webrtc/modules/video_coding/utility/simulcast_rate_allocator_unittest.cc
+++ b/webrtc/modules/video_coding/utility/simulcast_rate_allocator_unittest.cc
@@ -15,14 +15,28 @@
#include <utility>
#include <vector>
+#include "webrtc/test/gmock.h"
#include "webrtc/test/gtest.h"
namespace webrtc {
namespace {
+using ::testing::_;
+
constexpr uint32_t kMinBitrateKbps = 50;
constexpr uint32_t kTargetBitrateKbps = 100;
constexpr uint32_t kMaxBitrateKbps = 1000;
constexpr uint32_t kFramerateFps = 5;
+
+class MockTemporalLayers : public TemporalLayers {
+ public:
+ MOCK_METHOD1(EncodeFlags, int(uint32_t));
+ MOCK_METHOD3(OnRatesUpdated, std::vector<uint32_t>(int, int, int));
+ MOCK_METHOD1(UpdateConfiguration, bool(vpx_codec_enc_cfg_t*));
+ MOCK_METHOD3(PopulateCodecSpecific,
+ void(bool, CodecSpecificInfoVP8*, uint32_t));
+ MOCK_METHOD3(FrameEncoded, void(unsigned int, uint32_t, int));
+ MOCK_CONST_METHOD0(CurrentLayerId, int());
+};
} // namespace
class SimulcastRateAllocatorTest : public ::testing::TestWithParam<bool> {
@@ -251,6 +265,10 @@ TEST_F(SimulcastRateAllocatorTest, OneToThreeStreams) {
}
TEST_F(SimulcastRateAllocatorTest, GetPreferredBitrateBps) {
+ MockTemporalLayers mock_layers;
+ allocator_.reset(new SimulcastRateAllocator(codec_, nullptr));
+ allocator_->OnTemporalLayersCreated(0, &mock_layers);
+ EXPECT_CALL(mock_layers, OnRatesUpdated(_, _, _)).Times(0);
EXPECT_EQ(codec_.maxBitrate * 1000,
allocator_->GetPreferredBitrateBps(codec_.maxFramerate));
}
« no previous file with comments | « webrtc/modules/video_coding/utility/simulcast_rate_allocator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698