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

Unified Diff: webrtc/audio/audio_receive_stream_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: Fix for failing tests. Created 4 years, 9 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
« no previous file with comments | « webrtc/audio/audio_receive_stream.cc ('k') | webrtc/audio/audio_send_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/audio/audio_receive_stream_unittest.cc
diff --git a/webrtc/audio/audio_receive_stream_unittest.cc b/webrtc/audio/audio_receive_stream_unittest.cc
index 8703d6ed324819a0a041e823a88bf90db6f9e7ca..074aefe96115b07ec11fc195dcfb8021dbc37d54 100644
--- a/webrtc/audio/audio_receive_stream_unittest.cc
+++ b/webrtc/audio/audio_receive_stream_unittest.cc
@@ -15,6 +15,7 @@
#include "webrtc/audio/audio_receive_stream.h"
#include "webrtc/audio/conversion.h"
+#include "webrtc/call/mock/mock_rtc_event_log.h"
#include "webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h"
#include "webrtc/modules/congestion_controller/include/mock/mock_congestion_controller.h"
#include "webrtc/modules/pacing/packet_router.h"
@@ -66,7 +67,8 @@ struct ConfigHelper {
: simulated_clock_(123456),
congestion_controller_(&simulated_clock_,
&bitrate_observer_,
- &remote_bitrate_observer_) {
+ &remote_bitrate_observer_,
+ &event_log_) {
using testing::Invoke;
EXPECT_CALL(voice_engine_,
@@ -98,6 +100,12 @@ struct ConfigHelper {
.WillOnce(Return(&packet_router_));
EXPECT_CALL(*channel_proxy_, ResetCongestionControlObjects())
.Times(1);
+ testing::Expectation expect_set =
+ EXPECT_CALL(*channel_proxy_, SetRtcEventLog(testing::NotNull()))
the sun 2016/03/30 15:20:38 Could check for argument to be &event_log_ ?
ivoc 2016/03/31 09:06:56 Good idea, done.
+ .Times(1);
+ EXPECT_CALL(*channel_proxy_, SetRtcEventLog(testing::IsNull()))
+ .Times(1)
+ .After(expect_set);
return channel_proxy_;
}));
stream_config_.voe_channel_id = kChannelId;
@@ -117,6 +125,7 @@ struct ConfigHelper {
MockRemoteBitrateEstimator* remote_bitrate_estimator() {
return &remote_bitrate_estimator_;
}
+ MockRtcEventLog* event_log() { return &event_log_; }
AudioReceiveStream::Config& config() { return stream_config_; }
rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; }
MockVoiceEngine& voice_engine() { return voice_engine_; }
@@ -156,6 +165,7 @@ struct ConfigHelper {
testing::NiceMock<MockRemoteBitrateObserver> remote_bitrate_observer_;
MockCongestionController congestion_controller_;
MockRemoteBitrateEstimator remote_bitrate_estimator_;
+ MockRtcEventLog event_log_;
testing::StrictMock<MockVoiceEngine> voice_engine_;
rtc::scoped_refptr<AudioState> audio_state_;
AudioReceiveStream::Config stream_config_;
@@ -221,7 +231,8 @@ TEST(AudioReceiveStreamTest, ConfigToString) {
TEST(AudioReceiveStreamTest, ConstructDestruct) {
ConfigHelper helper;
internal::AudioReceiveStream recv_stream(
- helper.congestion_controller(), helper.config(), helper.audio_state());
+ helper.congestion_controller(), helper.config(), helper.audio_state(),
+ helper.event_log());
}
MATCHER_P(VerifyHeaderExtension, expected_extension, "") {
@@ -240,7 +251,8 @@ TEST(AudioReceiveStreamTest, AudioPacketUpdatesBweFeedback) {
helper.config().rtp.transport_cc = true;
helper.SetupMockForBweFeedback(true);
internal::AudioReceiveStream recv_stream(
- helper.congestion_controller(), helper.config(), helper.audio_state());
+ helper.congestion_controller(), helper.config(), helper.audio_state(),
+ helper.event_log());
const int kTransportSequenceNumberValue = 1234;
std::vector<uint8_t> rtp_packet = CreateRtpHeaderWithOneByteExtension(
kTransportSequenceNumberId, kTransportSequenceNumberValue, 2);
@@ -261,7 +273,8 @@ TEST(AudioReceiveStreamTest, AudioPacketUpdatesBweFeedback) {
TEST(AudioReceiveStreamTest, GetStats) {
ConfigHelper helper;
internal::AudioReceiveStream recv_stream(
- helper.congestion_controller(), helper.config(), helper.audio_state());
+ helper.congestion_controller(), helper.config(), helper.audio_state(),
+ helper.event_log());
helper.SetupMockForGetStats();
AudioReceiveStream::Stats stats = recv_stream.GetStats();
EXPECT_EQ(kRemoteSsrc, stats.remote_ssrc);
« no previous file with comments | « webrtc/audio/audio_receive_stream.cc ('k') | webrtc/audio/audio_send_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698