Updating bitrate controller tests to test naming conventions.
The test is now named 'bitrate_controller_unittests'. This CL also enables it on the bots. The test is excluded on ASAN since it fails when compiled with projects generated with GYP_DEFINES='asan=1' (see issue 555). BUG=None TEST=bitrate_controller_unittests was tested in Debug+Release on Linux, Mac and Windows + TSAN and memcheck. Review URL: https://webrtc-codereview.appspot.com/612004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2333 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
baaf2434a7
commit
2e84c112f5
@ -29,7 +29,19 @@
|
|||||||
'include/bitrate_controller.h',
|
'include/bitrate_controller.h',
|
||||||
'send_side_bandwidth_estimation.cc',
|
'send_side_bandwidth_estimation.cc',
|
||||||
'send_side_bandwidth_estimation.h',
|
'send_side_bandwidth_estimation.h',
|
||||||
], # source
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'target_name': 'bitrate_controller_unittests',
|
||||||
|
'type': 'executable',
|
||||||
|
'dependencies': [
|
||||||
|
'bitrate_controller',
|
||||||
|
'<(webrtc_root)/../test/test.gyp:test_support_main',
|
||||||
|
'<(webrtc_root)/../testing/gtest.gyp:gtest',
|
||||||
|
],
|
||||||
|
'sources': [
|
||||||
|
'bitrate_controller_unittest.cc',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
@ -23,21 +23,21 @@ using webrtc::BitrateController;
|
|||||||
class TestBitrateObserver: public BitrateObserver {
|
class TestBitrateObserver: public BitrateObserver {
|
||||||
public:
|
public:
|
||||||
TestBitrateObserver()
|
TestBitrateObserver()
|
||||||
: last_bitrate(0),
|
: last_bitrate_(0),
|
||||||
last_fraction_loss(0),
|
last_fraction_loss_(0),
|
||||||
last_rtt(0) {
|
last_rtt_(0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnNetworkChanged(const uint32_t bitrate,
|
virtual void OnNetworkChanged(const uint32_t bitrate,
|
||||||
const uint8_t fraction_loss,
|
const uint8_t fraction_loss,
|
||||||
const uint32_t rtt) {
|
const uint32_t rtt) {
|
||||||
last_bitrate = bitrate;
|
last_bitrate_ = bitrate;
|
||||||
last_fraction_loss = fraction_loss;
|
last_fraction_loss_ = fraction_loss;
|
||||||
last_rtt = rtt;
|
last_rtt_ = rtt;
|
||||||
}
|
}
|
||||||
uint32_t last_bitrate;
|
uint32_t last_bitrate_;
|
||||||
uint8_t last_fraction_loss;
|
uint8_t last_fraction_loss_;
|
||||||
uint32_t last_rtt;
|
uint32_t last_rtt_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BitrateControllerTest : public ::testing::Test {
|
class BitrateControllerTest : public ::testing::Test {
|
||||||
@ -74,42 +74,42 @@ TEST_F(BitrateControllerTest, OneBitrateObserverOneRtcpObserver) {
|
|||||||
|
|
||||||
// Test start bitrate.
|
// Test start bitrate.
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 1, 1);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 1, 1);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 0u);
|
EXPECT_EQ(0u, bitrate_observer.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer.last_fraction_loss, 0);
|
EXPECT_EQ(0, bitrate_observer.last_fraction_loss_);
|
||||||
EXPECT_EQ(bitrate_observer.last_rtt, 0u);
|
EXPECT_EQ(0u, bitrate_observer.last_rtt_);
|
||||||
|
|
||||||
// Test bitrate increase 8% per second.
|
// Test bitrate increase 8% per second.
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 21, 1001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 21, 1001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 217000u);
|
EXPECT_EQ(217000u, bitrate_observer.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer.last_fraction_loss, 0);
|
EXPECT_EQ(0, bitrate_observer.last_fraction_loss_);
|
||||||
EXPECT_EQ(bitrate_observer.last_rtt, 50u);
|
EXPECT_EQ(50u, bitrate_observer.last_rtt_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 41, 2001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 41, 2001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 235360u);
|
EXPECT_EQ(235360u, bitrate_observer.last_bitrate_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 61, 3001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 61, 3001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 255189u);
|
EXPECT_EQ(255189u, bitrate_observer.last_bitrate_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 801, 4001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 801, 4001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 276604u);
|
EXPECT_EQ(276604u, bitrate_observer.last_bitrate_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 101, 5001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 101, 5001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 299732u);
|
EXPECT_EQ(299732u, bitrate_observer.last_bitrate_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 121, 6001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 121, 6001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 300000u); // Max cap.
|
EXPECT_EQ(300000u, bitrate_observer.last_bitrate_); // Max cap.
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 141, 7001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 141, 7001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 300000u); // Max cap.
|
EXPECT_EQ(300000u, bitrate_observer.last_bitrate_); // Max cap.
|
||||||
|
|
||||||
// Test that a low REMB trigger immediately.
|
// Test that a low REMB trigger immediately.
|
||||||
bandwidth_observer_->OnReceivedEstimatedBitrate(250000);
|
bandwidth_observer_->OnReceivedEstimatedBitrate(250000);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 250000u);
|
EXPECT_EQ(250000u, bitrate_observer.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer.last_fraction_loss, 0);
|
EXPECT_EQ(0, bitrate_observer.last_fraction_loss_);
|
||||||
EXPECT_EQ(bitrate_observer.last_rtt, 50u);
|
EXPECT_EQ(50u, bitrate_observer.last_rtt_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedEstimatedBitrate(1000);
|
bandwidth_observer_->OnReceivedEstimatedBitrate(1000);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 100000u); // Min cap.
|
EXPECT_EQ(100000u, bitrate_observer.last_bitrate_); // Min cap.
|
||||||
controller_->RemoveBitrateObserver(&bitrate_observer);
|
controller_->RemoveBitrateObserver(&bitrate_observer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,53 +126,53 @@ TEST_F(BitrateControllerTest, OneBitrateObserverTwoRtcpObservers) {
|
|||||||
// Test start bitrate.
|
// Test start bitrate.
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 1, 1);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 1, 1);
|
||||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 100, 1, 1);
|
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 100, 1, 1);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 0u);
|
EXPECT_EQ(0u, bitrate_observer.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer.last_fraction_loss, 0);
|
EXPECT_EQ(0, bitrate_observer.last_fraction_loss_);
|
||||||
EXPECT_EQ(bitrate_observer.last_rtt, 0u);
|
EXPECT_EQ(0u, bitrate_observer.last_rtt_);
|
||||||
|
|
||||||
// Test bitrate increase 8% per second.
|
// Test bitrate increase 8% per second.
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 21, 501);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 21, 501);
|
||||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 100, 21, 1001);
|
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 100, 21, 1001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 217000u);
|
EXPECT_EQ(217000u, bitrate_observer.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer.last_fraction_loss, 0);
|
EXPECT_EQ(0, bitrate_observer.last_fraction_loss_);
|
||||||
EXPECT_EQ(bitrate_observer.last_rtt, 100u);
|
EXPECT_EQ(100u, bitrate_observer.last_rtt_);
|
||||||
|
|
||||||
// Extra report should not change estimate.
|
// Extra report should not change estimate.
|
||||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 100, 31, 1501);
|
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 100, 31, 1501);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 217000u);
|
EXPECT_EQ(217000u, bitrate_observer.last_bitrate_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 41, 2001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 41, 2001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 235360u);
|
EXPECT_EQ(235360u, bitrate_observer.last_bitrate_);
|
||||||
|
|
||||||
// Second report should not change estimate.
|
// Second report should not change estimate.
|
||||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 100, 41, 2001);
|
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 100, 41, 2001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 235360u);
|
EXPECT_EQ(235360u, bitrate_observer.last_bitrate_);
|
||||||
|
|
||||||
// Reports from only one bandwidth observer is ok.
|
// Reports from only one bandwidth observer is ok.
|
||||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 50, 61, 3001);
|
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 50, 61, 3001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 255189u);
|
EXPECT_EQ(255189u, bitrate_observer.last_bitrate_);
|
||||||
|
|
||||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 50, 81, 4001);
|
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 50, 81, 4001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 276604u);
|
EXPECT_EQ(276604u, bitrate_observer.last_bitrate_);
|
||||||
|
|
||||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 50, 101, 5001);
|
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 50, 101, 5001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 299732u);
|
EXPECT_EQ(299732u, bitrate_observer.last_bitrate_);
|
||||||
|
|
||||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 50, 121, 6001);
|
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 50, 121, 6001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 300000u); // Max cap.
|
EXPECT_EQ(300000u, bitrate_observer.last_bitrate_); // Max cap.
|
||||||
|
|
||||||
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 50, 141, 7001);
|
second_bandwidth_observer->OnReceivedRtcpReceiverReport(1, 0, 50, 141, 7001);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 300000u); // Max cap.
|
EXPECT_EQ(300000u, bitrate_observer.last_bitrate_); // Max cap.
|
||||||
|
|
||||||
// Test that a low REMB trigger immediately.
|
// Test that a low REMB trigger immediately.
|
||||||
// We don't care which bandwidth observer that delivers the REMB.
|
// We don't care which bandwidth observer that delivers the REMB.
|
||||||
second_bandwidth_observer->OnReceivedEstimatedBitrate(250000);
|
second_bandwidth_observer->OnReceivedEstimatedBitrate(250000);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 250000u);
|
EXPECT_EQ(250000u, bitrate_observer.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer.last_fraction_loss, 0);
|
EXPECT_EQ(0, bitrate_observer.last_fraction_loss_);
|
||||||
EXPECT_EQ(bitrate_observer.last_rtt, 50u);
|
EXPECT_EQ(50u, bitrate_observer.last_rtt_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedEstimatedBitrate(1000);
|
bandwidth_observer_->OnReceivedEstimatedBitrate(1000);
|
||||||
EXPECT_EQ(bitrate_observer.last_bitrate, 100000u); // Min cap.
|
EXPECT_EQ(100000u, bitrate_observer.last_bitrate_); // Min cap.
|
||||||
controller_->RemoveBitrateObserver(&bitrate_observer);
|
controller_->RemoveBitrateObserver(&bitrate_observer);
|
||||||
delete second_bandwidth_observer;
|
delete second_bandwidth_observer;
|
||||||
}
|
}
|
||||||
@ -191,72 +191,70 @@ TEST_F(BitrateControllerTest, TwoBitrateObserversOneRtcpObserver) {
|
|||||||
|
|
||||||
// Test bitrate increase 8% per second, distributed equally.
|
// Test bitrate increase 8% per second, distributed equally.
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 21, 1001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 21, 1001);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_bitrate, 100000u);
|
EXPECT_EQ(100000u, bitrate_observer_1.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_fraction_loss, 0);
|
EXPECT_EQ(0, bitrate_observer_1.last_fraction_loss_);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_rtt, 50u);
|
EXPECT_EQ(50u, bitrate_observer_1.last_rtt_);
|
||||||
|
|
||||||
EXPECT_EQ(bitrate_observer_2.last_bitrate, 200000u);
|
EXPECT_EQ(200000u, bitrate_observer_2.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer_2.last_fraction_loss, 0);
|
EXPECT_EQ(0, bitrate_observer_2.last_fraction_loss_);
|
||||||
EXPECT_EQ(bitrate_observer_2.last_rtt, 50u);
|
EXPECT_EQ(50u, bitrate_observer_2.last_rtt_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 41, 2001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 41, 2001);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_bitrate, 112500u);
|
EXPECT_EQ(112500u, bitrate_observer_1.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer_2.last_bitrate, 212500u);
|
EXPECT_EQ(212500u, bitrate_observer_2.last_bitrate_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 61, 3001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 61, 3001);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_bitrate, 126000u);
|
EXPECT_EQ(126000u, bitrate_observer_1.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer_2.last_bitrate, 226000u);
|
EXPECT_EQ(226000u, bitrate_observer_2.last_bitrate_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 81, 4001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 81, 4001);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_bitrate, 140580u);
|
EXPECT_EQ(140580u, bitrate_observer_1.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer_2.last_bitrate, 240580u);
|
EXPECT_EQ(240580u, bitrate_observer_2.last_bitrate_);
|
||||||
|
|
||||||
// Check that the bitrate sum honor our REMB.
|
// Check that the bitrate sum honor our REMB.
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 101, 5001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 101, 5001);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_bitrate, 150000u);
|
EXPECT_EQ(150000u, bitrate_observer_1.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer_2.last_bitrate, 250000u);
|
EXPECT_EQ(250000u, bitrate_observer_2.last_bitrate_);
|
||||||
|
|
||||||
// Remove REMB cap, higher than sum of max.
|
// Remove REMB cap, higher than sum of max.
|
||||||
bandwidth_observer_->OnReceivedEstimatedBitrate(700000);
|
bandwidth_observer_->OnReceivedEstimatedBitrate(700000);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 121, 6001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 121, 6001);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_bitrate, 166500u);
|
EXPECT_EQ(166500u, bitrate_observer_1.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer_2.last_bitrate, 266500u);
|
EXPECT_EQ(266500u, bitrate_observer_2.last_bitrate_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 141, 7001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 141, 7001);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_bitrate, 184320u);
|
EXPECT_EQ(184320u, bitrate_observer_1.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer_2.last_bitrate, 284320u);
|
EXPECT_EQ(284320u, bitrate_observer_2.last_bitrate_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 161, 8001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 161, 8001);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_bitrate, 207130u);
|
EXPECT_EQ(207130u, bitrate_observer_1.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer_2.last_bitrate, 300000u); // Max cap.
|
EXPECT_EQ(300000u, bitrate_observer_2.last_bitrate_); // Max cap.
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 181, 9001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 181, 9001);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_bitrate, 248700u);
|
EXPECT_EQ(248700u, bitrate_observer_1.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer_2.last_bitrate, 300000u);
|
EXPECT_EQ(300000u, bitrate_observer_2.last_bitrate_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 201, 10001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 201, 10001);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_bitrate, 293596u);
|
EXPECT_EQ(293596u, bitrate_observer_1.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer_2.last_bitrate, 300000u);
|
EXPECT_EQ(300000u, bitrate_observer_2.last_bitrate_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 221, 11001);
|
bandwidth_observer_->OnReceivedRtcpReceiverReport(1, 0, 50, 221, 11001);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_bitrate, 300000u); // Max cap.
|
EXPECT_EQ(300000u, bitrate_observer_1.last_bitrate_); // Max cap.
|
||||||
EXPECT_EQ(bitrate_observer_2.last_bitrate, 300000u);
|
EXPECT_EQ(300000u, bitrate_observer_2.last_bitrate_);
|
||||||
|
|
||||||
// Test that a low REMB trigger immediately.
|
// Test that a low REMB trigger immediately.
|
||||||
bandwidth_observer_->OnReceivedEstimatedBitrate(350000);
|
bandwidth_observer_->OnReceivedEstimatedBitrate(350000);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_bitrate, 125000u);
|
EXPECT_EQ(125000u, bitrate_observer_1.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_fraction_loss, 0);
|
EXPECT_EQ(0, bitrate_observer_1.last_fraction_loss_);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_rtt, 50u);
|
EXPECT_EQ(50u, bitrate_observer_1.last_rtt_);
|
||||||
EXPECT_EQ(bitrate_observer_2.last_bitrate, 225000u);
|
EXPECT_EQ(225000u, bitrate_observer_2.last_bitrate_);
|
||||||
EXPECT_EQ(bitrate_observer_2.last_fraction_loss, 0);
|
EXPECT_EQ(0, bitrate_observer_2.last_fraction_loss_);
|
||||||
EXPECT_EQ(bitrate_observer_2.last_rtt, 50u);
|
EXPECT_EQ(50u, bitrate_observer_2.last_rtt_);
|
||||||
|
|
||||||
bandwidth_observer_->OnReceivedEstimatedBitrate(1000);
|
bandwidth_observer_->OnReceivedEstimatedBitrate(1000);
|
||||||
EXPECT_EQ(bitrate_observer_1.last_bitrate, 100000u); // Min cap.
|
EXPECT_EQ(100000u, bitrate_observer_1.last_bitrate_); // Min cap.
|
||||||
EXPECT_EQ(bitrate_observer_2.last_bitrate, 200000u); // Min cap.
|
EXPECT_EQ(200000u, bitrate_observer_2.last_bitrate_); // Min cap.
|
||||||
controller_->RemoveBitrateObserver(&bitrate_observer_1);
|
controller_->RemoveBitrateObserver(&bitrate_observer_1);
|
||||||
controller_->RemoveBitrateObserver(&bitrate_observer_2);
|
controller_->RemoveBitrateObserver(&bitrate_observer_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
|
||||||
#
|
|
||||||
# Use of this source code is governed by a BSD-style license
|
|
||||||
# that can be found in the LICENSE file in the root of the source
|
|
||||||
# tree. An additional intellectual property rights grant can be found
|
|
||||||
# in the file PATENTS. All contributing project authors may
|
|
||||||
# be found in the AUTHORS file in the root of the source tree.
|
|
||||||
|
|
||||||
{
|
|
||||||
'targets': [
|
|
||||||
{
|
|
||||||
'target_name': 'test_bitrate_controller',
|
|
||||||
'type': 'executable',
|
|
||||||
'dependencies': [
|
|
||||||
'bitrate_controller',
|
|
||||||
'<(webrtc_root)/../test/test.gyp:test_support_main',
|
|
||||||
'<(webrtc_root)/../testing/gtest.gyp:gtest',
|
|
||||||
],
|
|
||||||
|
|
||||||
'include_dirs': [
|
|
||||||
'../include',
|
|
||||||
'../',
|
|
||||||
'../../../system_wrappers/interface',
|
|
||||||
],
|
|
||||||
|
|
||||||
'sources': [
|
|
||||||
'test_bitrate_controller.cc',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
||||||
# Local Variables:
|
|
||||||
# tab-width:2
|
|
||||||
# indent-tabs-mode:nil
|
|
||||||
# End:
|
|
||||||
# vim: set expandtab tabstop=2 shiftwidth=2:
|
|
@ -46,7 +46,6 @@
|
|||||||
'audio_coding/codecs/iSAC/isac_test.gypi',
|
'audio_coding/codecs/iSAC/isac_test.gypi',
|
||||||
'audio_coding/codecs/iSAC/isacfix_test.gypi',
|
'audio_coding/codecs/iSAC/isacfix_test.gypi',
|
||||||
'audio_processing/apm_tests.gypi',
|
'audio_processing/apm_tests.gypi',
|
||||||
'bitrate_controller/test/test_bitrate_controller.gypi',
|
|
||||||
'rtp_rtcp/source/rtp_rtcp_tests.gypi',
|
'rtp_rtcp/source/rtp_rtcp_tests.gypi',
|
||||||
'rtp_rtcp/test/test_bwe/test_bwe.gypi',
|
'rtp_rtcp/test/test_bwe/test_bwe.gypi',
|
||||||
'rtp_rtcp/test/testFec/test_fec.gypi',
|
'rtp_rtcp/test/testFec/test_fec.gypi',
|
||||||
|
@ -68,6 +68,7 @@ NORMAL_TESTS = {
|
|||||||
'audio_coding_unittests': (True, True, True),
|
'audio_coding_unittests': (True, True, True),
|
||||||
'audio_conference_mixer_unittests':(True, True, True),
|
'audio_conference_mixer_unittests':(True, True, True),
|
||||||
'audioproc_unittest': (True, True, True),
|
'audioproc_unittest': (True, True, True),
|
||||||
|
'bitrate_controller_unittests': (True, True, True),
|
||||||
'cng_unittests': (True, True, True),
|
'cng_unittests': (True, True, True),
|
||||||
'g711_unittests': (True, True, True),
|
'g711_unittests': (True, True, True),
|
||||||
'g722_unittests': (True, True, True),
|
'g722_unittests': (True, True, True),
|
||||||
|
@ -92,6 +92,7 @@ NORMAL_TESTS = {
|
|||||||
'audio_conference_mixer_unittests':(True, True, True),
|
'audio_conference_mixer_unittests':(True, True, True),
|
||||||
'audio_device_test_api': (False, True, False), # no audio devices
|
'audio_device_test_api': (False, True, False), # no audio devices
|
||||||
'audioproc_unittest': (True, True, True),
|
'audioproc_unittest': (True, True, True),
|
||||||
|
'bitrate_controller_unittests': (True, True, True),
|
||||||
'cng_unittests': (True, True, True),
|
'cng_unittests': (True, True, True),
|
||||||
'g711_unittests': (True, True, True),
|
'g711_unittests': (True, True, True),
|
||||||
'g722_unittests': (True, True, True),
|
'g722_unittests': (True, True, True),
|
||||||
@ -143,6 +144,7 @@ TSAN_DISABLED_TESTS = [
|
|||||||
]
|
]
|
||||||
ASAN_DISABLED_TESTS = [
|
ASAN_DISABLED_TESTS = [
|
||||||
'audio_coding_module_test', # Issue 281
|
'audio_coding_module_test', # Issue 281
|
||||||
|
'bitrate_controller_unittests', # Issue 555
|
||||||
'neteq_unittests', # Issue 282
|
'neteq_unittests', # Issue 282
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user