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

Unified Diff: webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc

Issue 1748403002: Move RtcEventLog object from inside VoiceEngine to Call. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Another rebase and accompanying changes. Created 4 years, 6 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
Index: webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc
diff --git a/webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc b/webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc
index 4f92a3884b5f44deedec188fbc08c63b59fd940e..f2a14ea9cfacbd3b404c95c4ccdd7d6a6c9f8740 100644
--- a/webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc
+++ b/webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc
@@ -13,6 +13,7 @@
#include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/call/mock/mock_rtc_event_log.h"
#include "webrtc/modules/bitrate_controller/include/bitrate_controller.h"
#include "webrtc/modules/pacing/mock/mock_paced_sender.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
@@ -66,8 +67,8 @@ class BitrateControllerTest : public ::testing::Test {
~BitrateControllerTest() {}
virtual void SetUp() {
- controller_ =
- BitrateController::CreateBitrateController(&clock_, &bitrate_observer_);
+ controller_ = BitrateController::CreateBitrateController(
+ &clock_, &bitrate_observer_, &event_log_);
controller_->SetStartBitrate(kStartBitrateBps);
EXPECT_EQ(kStartBitrateBps, bitrate_observer_.last_bitrate_);
controller_->SetMinMaxBitrate(kMinBitrateBps, kMaxBitrateBps);
@@ -91,6 +92,7 @@ class BitrateControllerTest : public ::testing::Test {
TestBitrateObserver bitrate_observer_;
BitrateController* controller_;
RtcpBandwidthObserver* bandwidth_observer_;
+ webrtc::MockRtcEventLog event_log_;
};
TEST_F(BitrateControllerTest, DefaultMinMaxBitrate) {
@@ -107,6 +109,7 @@ TEST_F(BitrateControllerTest, DefaultMinMaxBitrate) {
TEST_F(BitrateControllerTest, OneBitrateObserverOneRtcpObserver) {
// First REMB applies immediately.
+ EXPECT_CALL(event_log_, LogBwePacketLossEvent(testing::Gt(0), 0, 0)).Times(8);
int64_t time_ms = 1001;
webrtc::ReportBlockList report_blocks;
report_blocks.push_back(CreateReportBlock(1, 2, 0, 1));
@@ -183,6 +186,7 @@ TEST_F(BitrateControllerTest, OneBitrateObserverOneRtcpObserver) {
TEST_F(BitrateControllerTest, OneBitrateObserverTwoRtcpObservers) {
// REMBs during the first 2 seconds apply immediately.
+ EXPECT_CALL(event_log_, LogBwePacketLossEvent(testing::Gt(0), 0, 0)).Times(9);
int64_t time_ms = 1;
webrtc::ReportBlockList report_blocks;
report_blocks.push_back(CreateReportBlock(1, 2, 0, 1));
@@ -278,6 +282,13 @@ TEST_F(BitrateControllerTest, OneBitrateObserverTwoRtcpObservers) {
}
TEST_F(BitrateControllerTest, OneBitrateObserverMultipleReportBlocks) {
+ testing::Expectation first_calls =
+ EXPECT_CALL(event_log_, LogBwePacketLossEvent(testing::Gt(0), 0, 0))
+ .Times(7);
+ EXPECT_CALL(event_log_,
+ LogBwePacketLossEvent(testing::Gt(0), testing::Gt(0), 0))
+ .Times(2)
+ .After(first_calls);
uint32_t sequence_number[2] = {0, 0xFF00};
const int kStartBitrate = 200000;
const int kMinBitrate = 100000;

Powered by Google App Engine
This is Rietveld 408576698