Chromium Code Reviews| Index: media/audio/audio_manager_unittest.cc |
| diff --git a/media/audio/audio_manager_unittest.cc b/media/audio/audio_manager_unittest.cc |
| index 5063d073167c62438bd91834ac827a3655e5201f..e0a73f0e53193b4f315a5d24ca41690ec6a3bad1 100644 |
| --- a/media/audio/audio_manager_unittest.cc |
| +++ b/media/audio/audio_manager_unittest.cc |
| @@ -34,4 +34,44 @@ TEST(AudioManagerTest, GetAudioOutputDeviceNames) { |
| #endif // defined(USE_PULSEAUDIO) |
| } |
| +TEST(AudioManagerTest, GetDefaultOutputStreamParameters) { |
| +#if defined(OS_WIN) || defined(OS_MACOSX) |
|
henrika (OOO until Aug 14)
2013/09/07 08:04:25
Why inside and not outside the complete method?
tommi (sloooow) - chröme
2013/09/08 19:11:19
I'm following the style of the other test in this
|
| + scoped_ptr<AudioManager> audio_manager(AudioManager::Create()); |
| + ASSERT_TRUE(audio_manager); |
| + if (!audio_manager->HasAudioOutputDevices()) |
| + return; |
| + |
| + AudioParameters params = audio_manager->GetDefaultOutputStreamParameters(); |
| + EXPECT_TRUE(params.IsValid()); |
| +#endif // defined(OS_WIN) || defined(OS_MACOSX) |
| +} |
| + |
| +TEST(AudioManagerTest, GetAssociatedOutputDeviceID) { |
| +#if defined(OS_WIN) || defined(OS_MACOSX) |
| + scoped_ptr<AudioManager> audio_manager(AudioManager::Create()); |
| + ASSERT_TRUE(audio_manager); |
| + if (!audio_manager->HasAudioOutputDevices() || |
| + !audio_manager->HasAudioInputDevices()) { |
| + return; |
| + } |
| + |
| + AudioDeviceNames device_names; |
| + audio_manager->GetAudioInputDeviceNames(&device_names); |
| + bool found_an_associated_device = false; |
| + for (AudioDeviceNames::iterator it = device_names.begin(); |
| + it != device_names.end(); |
| + ++it) { |
| + EXPECT_FALSE(it->unique_id.empty()); |
| + EXPECT_FALSE(it->device_name.empty()); |
| + std::string output_device_id( |
| + audio_manager->GetAssociatedOutputDeviceID(it->unique_id)); |
| + if (!output_device_id.empty()) { |
| + VLOG(2) << it->unique_id << " matches with " << output_device_id; |
| + found_an_associated_device = true; |
| + } |
| + } |
| + |
| + EXPECT_TRUE(found_an_associated_device); |
|
henrika (OOO until Aug 14)
2013/09/07 08:04:25
Are we sure that this will be true on all boths wi
tommi (sloooow) - chröme
2013/09/08 19:11:19
I think it's a reasonable thing to expect (we have
|
| +#endif // defined(OS_WIN) || defined(OS_MACOSX) |
| +} |
| } // namespace media |