Index: webrtc/video/bitrate_estimator_tests.cc |
diff --git a/webrtc/video/bitrate_estimator_tests.cc b/webrtc/video/bitrate_estimator_tests.cc |
index 6e71ca24efe7d8b9269b96235af8df03ce6fcfb9..a0fdc92b6120001d04929814dd8f3b9aafd56f75 100644 |
--- a/webrtc/video/bitrate_estimator_tests.cc |
+++ b/webrtc/video/bitrate_estimator_tests.cc |
@@ -272,13 +272,16 @@ class BitrateEstimatorTest : public test::CallTest { |
std::vector<Stream*> streams_; |
}; |
+static const char* kAbsSendTimeLog = |
+ "RemoteBitrateEstimatorAbsSendTime: Instantiating."; |
+static const char* kSingleStreamLog = |
+ "RemoteBitrateEstimatorSingleStream: Instantiating."; |
+ |
TEST_F(BitrateEstimatorTest, InstantiatesTOFPerDefaultForVideo) { |
send_config_.rtp.extensions.push_back( |
RtpExtension(RtpExtension::kTOffset, kTOFExtensionId)); |
- receiver_trace_.PushExpectedLogLine( |
- "RemoteBitrateEstimatorFactory: Instantiating."); |
- receiver_trace_.PushExpectedLogLine( |
- "RemoteBitrateEstimatorFactory: Instantiating."); |
+ receiver_trace_.PushExpectedLogLine(kSingleStreamLog); |
+ receiver_trace_.PushExpectedLogLine(kSingleStreamLog); |
streams_.push_back(new Stream(this, false)); |
EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); |
} |
@@ -286,13 +289,10 @@ TEST_F(BitrateEstimatorTest, InstantiatesTOFPerDefaultForVideo) { |
TEST_F(BitrateEstimatorTest, ImmediatelySwitchToASTForAudio) { |
send_config_.rtp.extensions.push_back( |
RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId)); |
- receiver_trace_.PushExpectedLogLine( |
- "RemoteBitrateEstimatorFactory: Instantiating."); |
- receiver_trace_.PushExpectedLogLine( |
- "RemoteBitrateEstimatorFactory: Instantiating."); |
+ receiver_trace_.PushExpectedLogLine(kSingleStreamLog); |
+ receiver_trace_.PushExpectedLogLine(kSingleStreamLog); |
receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE."); |
- receiver_trace_.PushExpectedLogLine( |
- "AbsoluteSendTimeRemoteBitrateEstimatorFactory: Instantiating."); |
+ receiver_trace_.PushExpectedLogLine(kAbsSendTimeLog); |
streams_.push_back(new Stream(this, true)); |
EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); |
} |
@@ -300,30 +300,24 @@ TEST_F(BitrateEstimatorTest, ImmediatelySwitchToASTForAudio) { |
TEST_F(BitrateEstimatorTest, ImmediatelySwitchToASTForVideo) { |
send_config_.rtp.extensions.push_back( |
RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId)); |
- receiver_trace_.PushExpectedLogLine( |
- "RemoteBitrateEstimatorFactory: Instantiating."); |
- receiver_trace_.PushExpectedLogLine( |
- "RemoteBitrateEstimatorFactory: Instantiating."); |
+ receiver_trace_.PushExpectedLogLine(kSingleStreamLog); |
+ receiver_trace_.PushExpectedLogLine(kSingleStreamLog); |
receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE."); |
- receiver_trace_.PushExpectedLogLine( |
- "AbsoluteSendTimeRemoteBitrateEstimatorFactory: Instantiating."); |
+ receiver_trace_.PushExpectedLogLine(kAbsSendTimeLog); |
streams_.push_back(new Stream(this, false)); |
EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); |
} |
TEST_F(BitrateEstimatorTest, SwitchesToASTForAudio) { |
- receiver_trace_.PushExpectedLogLine( |
- "RemoteBitrateEstimatorFactory: Instantiating."); |
- receiver_trace_.PushExpectedLogLine( |
- "RemoteBitrateEstimatorFactory: Instantiating."); |
+ receiver_trace_.PushExpectedLogLine(kSingleStreamLog); |
+ receiver_trace_.PushExpectedLogLine(kSingleStreamLog); |
streams_.push_back(new Stream(this, true)); |
EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); |
send_config_.rtp.extensions.push_back( |
RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId)); |
receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE."); |
- receiver_trace_.PushExpectedLogLine( |
- "AbsoluteSendTimeRemoteBitrateEstimatorFactory: Instantiating."); |
+ receiver_trace_.PushExpectedLogLine(kAbsSendTimeLog); |
streams_.push_back(new Stream(this, true)); |
EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); |
} |
@@ -331,18 +325,15 @@ TEST_F(BitrateEstimatorTest, SwitchesToASTForAudio) { |
TEST_F(BitrateEstimatorTest, SwitchesToASTForVideo) { |
send_config_.rtp.extensions.push_back( |
RtpExtension(RtpExtension::kTOffset, kTOFExtensionId)); |
- receiver_trace_.PushExpectedLogLine( |
- "RemoteBitrateEstimatorFactory: Instantiating."); |
- receiver_trace_.PushExpectedLogLine( |
- "RemoteBitrateEstimatorFactory: Instantiating."); |
+ receiver_trace_.PushExpectedLogLine(kSingleStreamLog); |
+ receiver_trace_.PushExpectedLogLine(kSingleStreamLog); |
streams_.push_back(new Stream(this, false)); |
EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); |
send_config_.rtp.extensions[0] = |
RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId); |
receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE."); |
- receiver_trace_.PushExpectedLogLine( |
- "AbsoluteSendTimeRemoteBitrateEstimatorFactory: Instantiating."); |
+ receiver_trace_.PushExpectedLogLine(kAbsSendTimeLog); |
streams_.push_back(new Stream(this, false)); |
EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); |
} |
@@ -350,18 +341,15 @@ TEST_F(BitrateEstimatorTest, SwitchesToASTForVideo) { |
TEST_F(BitrateEstimatorTest, SwitchesToASTThenBackToTOFForVideo) { |
send_config_.rtp.extensions.push_back( |
RtpExtension(RtpExtension::kTOffset, kTOFExtensionId)); |
- receiver_trace_.PushExpectedLogLine( |
- "RemoteBitrateEstimatorFactory: Instantiating."); |
- receiver_trace_.PushExpectedLogLine( |
- "RemoteBitrateEstimatorFactory: Instantiating."); |
+ receiver_trace_.PushExpectedLogLine(kSingleStreamLog); |
+ receiver_trace_.PushExpectedLogLine(kSingleStreamLog); |
streams_.push_back(new Stream(this, false)); |
EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); |
send_config_.rtp.extensions[0] = |
RtpExtension(RtpExtension::kAbsSendTime, kASTExtensionId); |
receiver_trace_.PushExpectedLogLine("Switching to absolute send time RBE."); |
- receiver_trace_.PushExpectedLogLine( |
- "AbsoluteSendTimeRemoteBitrateEstimatorFactory: Instantiating."); |
+ receiver_trace_.PushExpectedLogLine(kAbsSendTimeLog); |
streams_.push_back(new Stream(this, false)); |
EXPECT_EQ(kEventSignaled, receiver_trace_.Wait()); |
@@ -369,8 +357,7 @@ TEST_F(BitrateEstimatorTest, SwitchesToASTThenBackToTOFForVideo) { |
RtpExtension(RtpExtension::kTOffset, kTOFExtensionId); |
receiver_trace_.PushExpectedLogLine( |
"WrappingBitrateEstimator: Switching to transmission time offset RBE."); |
- receiver_trace_.PushExpectedLogLine( |
- "RemoteBitrateEstimatorFactory: Instantiating."); |
+ receiver_trace_.PushExpectedLogLine(kSingleStreamLog); |
streams_.push_back(new Stream(this, false)); |
streams_[0]->StopSending(); |
streams_[1]->StopSending(); |