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

Unified Diff: webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor_impl_unittest.cc

Issue 2559953002: Log audio network adapter decisions in event log. (Closed)
Patch Set: Revert ana dump changes Created 3 years, 11 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/audio_coding/audio_network_adaptor/audio_network_adaptor_impl_unittest.cc
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor_impl_unittest.cc b/webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor_impl_unittest.cc
index b26d2f5db8faac77a0a62168ef4dedc64adc47aa..9b608dce479922afb0c4918e0285f5a2e9f67f3c 100644
--- a/webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor_impl_unittest.cc
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor_impl_unittest.cc
@@ -11,6 +11,7 @@
#include <utility>
#include <vector>
+#include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h"
#include "webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor_impl.h"
#include "webrtc/modules/audio_coding/audio_network_adaptor/mock/mock_controller.h"
#include "webrtc/modules/audio_coding/audio_network_adaptor/mock/mock_controller_manager.h"
@@ -52,6 +53,7 @@ struct AudioNetworkAdaptorStates {
std::unique_ptr<AudioNetworkAdaptorImpl> audio_network_adaptor;
std::vector<std::unique_ptr<MockController>> mock_controllers;
std::unique_ptr<SimulatedClock> simulated_clock;
+ std::unique_ptr<MockRtcEventLog> event_log;
MockDebugDumpWriter* mock_debug_dump_writer;
};
@@ -76,6 +78,7 @@ AudioNetworkAdaptorStates CreateAudioNetworkAdaptor() {
.WillRepeatedly(Return(controllers));
states.simulated_clock.reset(new SimulatedClock(kClockInitialTimeMs * 1000));
+ states.event_log.reset(new NiceMock<MockRtcEventLog>());
auto debug_dump_writer =
std::unique_ptr<MockDebugDumpWriter>(new NiceMock<MockDebugDumpWriter>());
@@ -84,6 +87,7 @@ AudioNetworkAdaptorStates CreateAudioNetworkAdaptor() {
AudioNetworkAdaptorImpl::Config config;
config.clock = states.simulated_clock.get();
+ config.event_log = states.event_log.get();
// AudioNetworkAdaptorImpl governs the lifetime of controller manager.
states.audio_network_adaptor.reset(new AudioNetworkAdaptorImpl(
config,
@@ -205,4 +209,20 @@ TEST(AudioNetworkAdaptorImplTest,
states.audio_network_adaptor->SetOverhead(kOverhead);
}
+TEST(AudioNetworkAdaptorImplTest, LogRuntimeConfigOnGetEncoderRuntimeConfig) {
+ auto states = CreateAudioNetworkAdaptor();
+
+ AudioNetworkAdaptor::EncoderRuntimeConfig config;
+ config.bitrate_bps = rtc::Optional<int>(32000);
+ config.enable_fec = rtc::Optional<bool>(true);
+
+ EXPECT_CALL(*states.mock_controllers[0], MakeDecision(_, _))
+ .WillOnce(SetArgPointee<1>(config));
+
+ EXPECT_CALL(*states.event_log,
+ LogAudioNetworkAdaptation(EncoderRuntimeConfigIs(config)))
+ .Times(1);
+ states.audio_network_adaptor->GetEncoderRuntimeConfig();
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698