diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 23:18:48 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 23:18:48 +0000 |
commit | 2f6d086da79c737bc2a0ee3023ca80c608c75d19 (patch) | |
tree | 6943204cb1c9c7d7cbe722f91a64a1c326601fef /media/audio/audio_output_controller_unittest.cc | |
parent | 87949cc2b85979964ca9de9483ba1ba2758e0b81 (diff) | |
download | chromium_src-2f6d086da79c737bc2a0ee3023ca80c608c75d19.zip chromium_src-2f6d086da79c737bc2a0ee3023ca80c608c75d19.tar.gz chromium_src-2f6d086da79c737bc2a0ee3023ca80c608c75d19.tar.bz2 |
Add AudioParameters struct. Use it everywhere.
BUG=None
TEST=unittests
Review URL: http://codereview.chromium.org/3226012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58097 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/audio_output_controller_unittest.cc')
-rw-r--r-- | media/audio/audio_output_controller_unittest.cc | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/media/audio/audio_output_controller_unittest.cc b/media/audio/audio_output_controller_unittest.cc index 9383c9d..db1716c 100644 --- a/media/audio/audio_output_controller_unittest.cc +++ b/media/audio/audio_output_controller_unittest.cc @@ -17,7 +17,7 @@ using ::testing::InvokeWithoutArgs; using ::testing::NotNull; using ::testing::Return; -static const int kSampleRate = AudioManager::kAudioCDSampleRate; +static const int kSampleRate = AudioParameters::kAudioCDSampleRate; static const int kBitsPerSample = 16; static const int kChannels = 2; static const int kHardwareBufferSize = kSampleRate * kBitsPerSample * @@ -85,10 +85,10 @@ TEST(AudioOutputControllerTest, CreateAndClose) { return; MockAudioOutputControllerEventHandler event_handler; + AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kChannels, + kSampleRate, kBitsPerSample); scoped_refptr<AudioOutputController> controller = - AudioOutputController::Create(&event_handler, - AudioManager::AUDIO_PCM_LINEAR, kChannels, - kSampleRate, kBitsPerSample, + AudioOutputController::Create(&event_handler, params, kHardwareBufferSize, kBufferCapacity); ASSERT_TRUE(controller.get()); @@ -120,10 +120,10 @@ TEST(AudioOutputControllerTest, PlayAndClose) { .Times(AtLeast(10)) .WillRepeatedly(SignalEvent(&event, &count, 10)); + AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kChannels, + kSampleRate, kBitsPerSample); scoped_refptr<AudioOutputController> controller = - AudioOutputController::Create(&event_handler, - AudioManager::AUDIO_PCM_LINEAR, kChannels, - kSampleRate, kBitsPerSample, + AudioOutputController::Create(&event_handler, params, kHardwareBufferSize, kBufferCapacity); ASSERT_TRUE(controller.get()); @@ -166,10 +166,10 @@ TEST(AudioOutputControllerTest, PlayPauseClose) { .Times(Exactly(1)) .WillOnce(InvokeWithoutArgs(&event, &base::WaitableEvent::Signal)); + AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kChannels, + kSampleRate, kBitsPerSample); scoped_refptr<AudioOutputController> controller = - AudioOutputController::Create(&event_handler, - AudioManager::AUDIO_PCM_LINEAR, kChannels, - kSampleRate, kBitsPerSample, + AudioOutputController::Create(&event_handler, params, kHardwareBufferSize, kBufferCapacity); ASSERT_TRUE(controller.get()); @@ -224,10 +224,10 @@ TEST(AudioOutputControllerTest, PlayPausePlay) { .Times(Exactly(1)) .RetiresOnSaturation(); + AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kChannels, + kSampleRate, kBitsPerSample); scoped_refptr<AudioOutputController> controller = - AudioOutputController::Create(&event_handler, - AudioManager::AUDIO_PCM_LINEAR, kChannels, - kSampleRate, kBitsPerSample, + AudioOutputController::Create(&event_handler, params, kHardwareBufferSize, kBufferCapacity); ASSERT_TRUE(controller.get()); @@ -261,10 +261,10 @@ TEST(AudioOutputControllerTest, HardwareBufferTooLarge) { // Create an audio device with a very large hardware buffer size. MockAudioOutputControllerEventHandler event_handler; + AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kChannels, + kSampleRate, kBitsPerSample); scoped_refptr<AudioOutputController> controller = - AudioOutputController::Create(&event_handler, - AudioManager::AUDIO_PCM_LINEAR, kChannels, - kSampleRate, kBitsPerSample, + AudioOutputController::Create(&event_handler, params, kHardwareBufferSize * 1000, kBufferCapacity); @@ -289,10 +289,10 @@ TEST(AudioOutputControllerTest, CloseTwice) { .Times(AtLeast(1)) .WillRepeatedly(SignalEvent(&event)); + AudioParameters params(AudioParameters::AUDIO_PCM_LINEAR, kChannels, + kSampleRate, kBitsPerSample); scoped_refptr<AudioOutputController> controller = - AudioOutputController::Create(&event_handler, - AudioManager::AUDIO_PCM_LINEAR, kChannels, - kSampleRate, kBitsPerSample, + AudioOutputController::Create(&event_handler, params, kHardwareBufferSize, kBufferCapacity); ASSERT_TRUE(controller.get()); |