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

Unified Diff: content/renderer/media/webrtc_audio_device_unittest.cc

Issue 9702019: Adds Analog Gain Control (AGC) to the WebRTC client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improved volume updating on Mac Created 8 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
Index: content/renderer/media/webrtc_audio_device_unittest.cc
diff --git a/content/renderer/media/webrtc_audio_device_unittest.cc b/content/renderer/media/webrtc_audio_device_unittest.cc
index 4cf33379daa6114e62284ad43c0b68d929dfd06a..aa8a9cdd71d58af04620bb7b611ba2a10cf11f4f 100644
--- a/content/renderer/media/webrtc_audio_device_unittest.cc
+++ b/content/renderer/media/webrtc_audio_device_unittest.cc
@@ -437,6 +437,7 @@ TEST_F(WebRTCAudioDeviceTest, PlayLocalFile) {
EXPECT_EQ(0, base->StartPlayout(ch));
ScopedWebRTCPtr<webrtc::VoEFile> file(engine.get());
+ ASSERT_TRUE(file.valid());
int duration = 0;
EXPECT_EQ(0, file->GetFileDuration(file_path.c_str(), duration,
webrtc::kFileFormatPcm16kHzFile));
@@ -465,8 +466,8 @@ TEST_F(WebRTCAudioDeviceTest, PlayLocalFile) {
// where they are decoded and played out on the default audio output device.
// Disabled when running headless since the bots don't have the required config.
// TODO(henrika): improve quality by using a wideband codec, enabling noise-
-// suppressions and perhaps also the digital AGC.
-TEST_F(WebRTCAudioDeviceTest, FullDuplexAudio) {
+// suppressions etc.
+TEST_F(WebRTCAudioDeviceTest, FullDuplexAudioWithAGC) {
if (IsRunningHeadless())
return;
@@ -477,13 +478,13 @@ TEST_F(WebRTCAudioDeviceTest, FullDuplexAudio) {
return;
EXPECT_CALL(media_observer(),
- OnSetAudioStreamStatus(_, 1, StrEq("created")));
+ OnSetAudioStreamStatus(_, 1, StrEq("created")));
EXPECT_CALL(media_observer(),
- OnSetAudioStreamPlaying(_, 1, true));
+ OnSetAudioStreamPlaying(_, 1, true));
EXPECT_CALL(media_observer(),
- OnSetAudioStreamStatus(_, 1, StrEq("closed")));
+ OnSetAudioStreamStatus(_, 1, StrEq("closed")));
EXPECT_CALL(media_observer(),
- OnDeleteAudioStream(_, 1)).Times(AnyNumber());
+ OnDeleteAudioStream(_, 1)).Times(AnyNumber());
scoped_refptr<WebRtcAudioDeviceImpl> audio_device(
new WebRtcAudioDeviceImpl());
@@ -496,10 +497,19 @@ TEST_F(WebRTCAudioDeviceTest, FullDuplexAudio) {
int err = base->Init(audio_device);
ASSERT_EQ(0, err);
+ ScopedWebRTCPtr<webrtc::VoEAudioProcessing> audio_processing(engine.get());
+ ASSERT_TRUE(audio_processing.valid());
+ bool enabled = false;
+ webrtc::AgcModes agc_mode = webrtc::kAgcDefault;
+ EXPECT_EQ(0, audio_processing->GetAgcStatus(enabled, agc_mode));
+ EXPECT_TRUE(enabled);
+ EXPECT_EQ(agc_mode, webrtc::kAgcAdaptiveAnalog);
+
int ch = base->CreateChannel();
EXPECT_NE(-1, ch);
ScopedWebRTCPtr<webrtc::VoENetwork> network(engine.get());
+ ASSERT_TRUE(network.valid());
scoped_ptr<WebRTCTransportImpl> transport(
new WebRTCTransportImpl(network.get()));
EXPECT_EQ(0, network->RegisterExternalTransport(ch, *transport.get()));

Powered by Google App Engine
This is Rietveld 408576698