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

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

Issue 12316131: Moved AudioUtil static functions to AudioManager interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: made the GetPreferredOutputStreamParameters protected Created 7 years, 10 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 | « content/browser/renderer_host/render_message_filter.cc ('k') | media/audio/android/audio_manager_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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())
« no previous file with comments | « content/browser/renderer_host/render_message_filter.cc ('k') | media/audio/android/audio_manager_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698