Re-enable the BitrateEstimatorTest cases for the Call API.

BUG=
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/18439004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6141 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
solenberg@webrtc.org 2014-05-14 09:15:19 +00:00
parent 5c49c64de5
commit db60434b31
2 changed files with 14 additions and 11 deletions

View File

@ -236,7 +236,7 @@ RemoteBitrateEstimator* RemoteBitrateEstimatorFactory::Create(
Clock* clock,
RateControlType control_type,
uint32_t min_bitrate_bps) const {
LOG(LS_INFO) << "RemoteBitrateEstimatorSingleStream: Instantiating.";
LOG(LS_INFO) << "RemoteBitrateEstimatorFactory: Instantiating.";
return new RemoteBitrateEstimatorSingleStream(observer, clock,
min_bitrate_bps);
}

View File

@ -18,6 +18,7 @@
#include "webrtc/system_wrappers/interface/event_wrapper.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/system_wrappers/interface/thread_annotations.h"
#include "webrtc/system_wrappers/interface/trace.h"
#include "webrtc/test/direct_transport.h"
#include "webrtc/test/encoder_settings.h"
#include "webrtc/test/fake_decoder.h"
@ -52,8 +53,11 @@ class BitrateEstimatorTest : public ::testing::Test {
}
virtual void SetUp() {
// Create receiver call first so that we are guaranteed to have a trace
// callback when sender call is created.
Trace::CreateTrace();
Trace::SetTraceCallback(&receiver_trace_);
// Reduce the chance that spurious traces will ruin the test.
Trace::set_level_filter(kTraceTerseInfo);
Call::Config receiver_call_config(&receive_transport_);
receiver_call_.reset(Call::Create(receiver_call_config));
@ -95,8 +99,10 @@ class BitrateEstimatorTest : public ::testing::Test {
streams_.pop_back();
}
// The TraceCallback instance MUST outlive Calls, destroy Calls explicitly.
receiver_call_.reset();
Trace::SetTraceCallback(NULL);
Trace::ReturnTrace();
}
protected:
@ -120,9 +126,6 @@ class BitrateEstimatorTest : public ::testing::Test {
const char* message,
int length) OVERRIDE {
CriticalSectionScoped lock(crit_sect_.get());
if (!(level & kTraceStateInfo)) {
return;
}
std::string msg(message);
if (msg.find("BitrateEstimator") != std::string::npos) {
received_log_lines_.push_back(msg);
@ -228,7 +231,7 @@ class BitrateEstimatorTest : public ::testing::Test {
std::vector<Stream*> streams_;
};
TEST_F(BitrateEstimatorTest, DISABLED_InstantiatesTOFPerDefault) {
TEST_F(BitrateEstimatorTest, InstantiatesTOFPerDefault) {
send_config_.rtp.extensions.push_back(
RtpExtension(RtpExtension::kTOffset, kTOFExtensionId));
receiver_trace_.PushExpectedLogLine(
@ -239,7 +242,7 @@ TEST_F(BitrateEstimatorTest, DISABLED_InstantiatesTOFPerDefault) {
EXPECT_EQ(kEventSignaled, receiver_trace_.Wait());
}
TEST_F(BitrateEstimatorTest, DISABLED_ImmediatelySwitchToAST) {
TEST_F(BitrateEstimatorTest, ImmediatelySwitchToAST) {
send_config_.rtp.extensions.push_back(
RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId));
receiver_trace_.PushExpectedLogLine(
@ -253,7 +256,7 @@ TEST_F(BitrateEstimatorTest, DISABLED_ImmediatelySwitchToAST) {
EXPECT_EQ(kEventSignaled, receiver_trace_.Wait());
}
TEST_F(BitrateEstimatorTest, DISABLED_SwitchesToAST) {
TEST_F(BitrateEstimatorTest, SwitchesToAST) {
send_config_.rtp.extensions.push_back(
RtpExtension(RtpExtension::kTOffset, kTOFExtensionId));
receiver_trace_.PushExpectedLogLine(
@ -272,7 +275,7 @@ TEST_F(BitrateEstimatorTest, DISABLED_SwitchesToAST) {
EXPECT_EQ(kEventSignaled, receiver_trace_.Wait());
}
TEST_F(BitrateEstimatorTest, DISABLED_SwitchesToASTThenBackToTOF) {
TEST_F(BitrateEstimatorTest, SwitchesToASTThenBackToTOF) {
send_config_.rtp.extensions.push_back(
RtpExtension(RtpExtension::kTOffset, kTOFExtensionId));
receiver_trace_.PushExpectedLogLine(