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

Unified Diff: media/base/audio_hardware_config_unittest.cc

Issue 12662038: Revert 187936 "Pass more detailed audio hardware configuration i..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1440/src/
Patch Set: Created 7 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 | « media/base/audio_hardware_config.cc ('k') | media/base/channel_layout.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_hardware_config_unittest.cc
===================================================================
--- media/base/audio_hardware_config_unittest.cc (revision 189875)
+++ media/base/audio_hardware_config_unittest.cc (working copy)
@@ -3,34 +3,20 @@
// found in the LICENSE file.
#include "media/base/audio_hardware_config.h"
-#include "media/audio/audio_parameters.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
static const int kOutputBufferSize = 2048;
static const int kOutputSampleRate = 48000;
-static const ChannelLayout kOutputChannelLayout = CHANNEL_LAYOUT_STEREO;
static const int kInputSampleRate = 44100;
static const ChannelLayout kInputChannelLayout = CHANNEL_LAYOUT_STEREO;
TEST(AudioHardwareConfig, Getters) {
- AudioParameters input_params(
- AudioParameters::AUDIO_PCM_LOW_LATENCY,
- kInputChannelLayout,
- kInputSampleRate,
- 16,
- kOutputBufferSize);
+ AudioHardwareConfig fake_config(
+ kOutputBufferSize, kOutputSampleRate, kInputSampleRate,
+ kInputChannelLayout);
- AudioParameters output_params(
- AudioParameters::AUDIO_PCM_LOW_LATENCY,
- kOutputChannelLayout,
- kOutputSampleRate,
- 16,
- kOutputBufferSize);
-
- AudioHardwareConfig fake_config(input_params, output_params);
-
EXPECT_EQ(kOutputBufferSize, fake_config.GetOutputBufferSize());
EXPECT_EQ(kOutputSampleRate, fake_config.GetOutputSampleRate());
EXPECT_EQ(kInputSampleRate, fake_config.GetInputSampleRate());
@@ -38,35 +24,16 @@
}
TEST(AudioHardwareConfig, Setters) {
- AudioParameters input_params(
- AudioParameters::AUDIO_PCM_LOW_LATENCY,
- kInputChannelLayout,
- kInputSampleRate,
- 16,
- kOutputBufferSize);
+ AudioHardwareConfig fake_config(
+ kOutputBufferSize, kOutputSampleRate, kInputSampleRate,
+ kInputChannelLayout);
- AudioParameters output_params(
- AudioParameters::AUDIO_PCM_LOW_LATENCY,
- kOutputChannelLayout,
- kOutputSampleRate,
- 16,
- kOutputBufferSize);
-
- AudioHardwareConfig fake_config(input_params, output_params);
-
// Verify output parameters.
const int kNewOutputBufferSize = kOutputBufferSize * 2;
const int kNewOutputSampleRate = kOutputSampleRate * 2;
EXPECT_NE(kNewOutputBufferSize, fake_config.GetOutputBufferSize());
EXPECT_NE(kNewOutputSampleRate, fake_config.GetOutputSampleRate());
-
- AudioParameters new_output_params(
- AudioParameters::AUDIO_PCM_LOW_LATENCY,
- kOutputChannelLayout,
- kNewOutputSampleRate,
- 16,
- kNewOutputBufferSize);
- fake_config.UpdateOutputConfig(new_output_params);
+ fake_config.UpdateOutputConfig(kNewOutputBufferSize, kNewOutputSampleRate);
EXPECT_EQ(kNewOutputBufferSize, fake_config.GetOutputBufferSize());
EXPECT_EQ(kNewOutputSampleRate, fake_config.GetOutputSampleRate());
@@ -75,14 +42,7 @@
const ChannelLayout kNewInputChannelLayout = CHANNEL_LAYOUT_MONO;
EXPECT_NE(kNewInputSampleRate, fake_config.GetInputSampleRate());
EXPECT_NE(kNewInputChannelLayout, fake_config.GetInputChannelLayout());
-
- AudioParameters new_input_params(
- AudioParameters::AUDIO_PCM_LOW_LATENCY,
- kNewInputChannelLayout,
- kNewInputSampleRate,
- 16,
- kOutputBufferSize);
- fake_config.UpdateInputConfig(new_input_params);
+ fake_config.UpdateInputConfig(kNewInputSampleRate, kNewInputChannelLayout);
EXPECT_EQ(kNewInputSampleRate, fake_config.GetInputSampleRate());
EXPECT_EQ(kNewInputChannelLayout, fake_config.GetInputChannelLayout());
}
« no previous file with comments | « media/base/audio_hardware_config.cc ('k') | media/base/channel_layout.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698