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 42e9c6d52e6cfb4f7673d7c99334e6cd8a0b8b9b..e04eafc94bb15c7b34bb3dac77dae6c785a105a4 100644 |
--- a/content/renderer/media/webrtc_audio_device_unittest.cc |
+++ b/content/renderer/media/webrtc_audio_device_unittest.cc |
@@ -10,7 +10,6 @@ |
#include "content/renderer/render_thread_impl.h" |
#include "content/test/webrtc_audio_device_test.h" |
#include "media/audio/audio_manager_base.h" |
-#include "media/audio/audio_util.h" |
#include "media/base/audio_hardware_config.h" |
#include "testing/gmock/include/gmock/gmock.h" |
#include "third_party/webrtc/voice_engine/include/voe_audio_processing.h" |
@@ -31,13 +30,16 @@ namespace { |
const int kRenderViewId = 1; |
-scoped_ptr<media::AudioHardwareConfig> CreateRealHardwareConfig() { |
+scoped_ptr<media::AudioHardwareConfig> CreateRealHardwareConfig( |
+ media::AudioManager* manager) { |
+ const media::AudioParameters output_parameters = |
+ manager->GetDefaultOutputStreamParameters(); |
+ const media::AudioParameters input_parameters = |
+ manager->GetInputStreamParameters( |
+ media::AudioManagerBase::kDefaultDeviceId); |
return make_scoped_ptr(new media::AudioHardwareConfig( |
- media::GetAudioHardwareBufferSize(), media::GetAudioHardwareSampleRate(), |
- media::GetAudioInputHardwareSampleRate( |
- media::AudioManagerBase::kDefaultDeviceId), |
- media::GetAudioInputHardwareChannelLayout( |
- media::AudioManagerBase::kDefaultDeviceId))); |
+ output_parameters.frames_per_buffer(), output_parameters.sample_rate(), |
+ input_parameters.sample_rate(), input_parameters.channel_layout())); |
} |
// Return true if at least one element in the array matches |value|. |
@@ -250,7 +252,8 @@ TEST_F(WebRTCAudioDeviceTest, DISABLED_StartPlayout) { |
return; |
} |
- scoped_ptr<media::AudioHardwareConfig> config = CreateRealHardwareConfig(); |
+ scoped_ptr<media::AudioHardwareConfig> config = |
+ CreateRealHardwareConfig(audio_manager_.get()); |
SetAudioHardwareConfig(config.get()); |
if (!HardwareSampleRatesAreValid()) |
@@ -336,7 +339,8 @@ TEST_F(WebRTCAudioDeviceTest, MAYBE_StartRecording) { |
return; |
} |
- scoped_ptr<media::AudioHardwareConfig> config = CreateRealHardwareConfig(); |
+ scoped_ptr<media::AudioHardwareConfig> config = |
+ CreateRealHardwareConfig(audio_manager_.get()); |
SetAudioHardwareConfig(config.get()); |
if (!HardwareSampleRatesAreValid()) |
@@ -409,7 +413,8 @@ TEST_F(WebRTCAudioDeviceTest, DISABLED_PlayLocalFile) { |
std::string file_path( |
GetTestDataPath(FILE_PATH_LITERAL("speechmusic_mono_16kHz.pcm"))); |
- scoped_ptr<media::AudioHardwareConfig> config = CreateRealHardwareConfig(); |
+ scoped_ptr<media::AudioHardwareConfig> config = |
+ CreateRealHardwareConfig(audio_manager_.get()); |
SetAudioHardwareConfig(config.get()); |
if (!HardwareSampleRatesAreValid()) |
@@ -486,7 +491,8 @@ TEST_F(WebRTCAudioDeviceTest, MAYBE_FullDuplexAudioWithAGC) { |
return; |
} |
- scoped_ptr<media::AudioHardwareConfig> config = CreateRealHardwareConfig(); |
+ scoped_ptr<media::AudioHardwareConfig> config = |
+ CreateRealHardwareConfig(audio_manager_.get()); |
SetAudioHardwareConfig(config.get()); |
if (!HardwareSampleRatesAreValid()) |