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 fc2d7034923d5e6f9e114789c402d7bd46a28d44..90834efd6441a17b3bfc0e28d5053dedb24e252d 100644 |
| --- a/media/audio/audio_manager_unittest.cc |
| +++ b/media/audio/audio_manager_unittest.cc |
| @@ -8,20 +8,15 @@ |
| #include "testing/gtest/include/gtest/gtest.h" |
| #if defined(OS_LINUX) |
| +#include "media/audio/linux/audio_manager_linux.h" |
| #include "media/audio/pulse/audio_manager_pulse.h" |
| -#endif |
| +#endif // defined(OS_LINUX) |
| namespace media { |
| -// TODO(joi): Remove guards once implemented for all platforms. |
| -#if defined(OS_LINUX) |
| -TEST(AudioManagerTest, GetAudioOutputDeviceNames) { |
| - scoped_ptr<AudioManager> audio_manager_pulse(AudioManagerPulse::Create()); |
| - if (!audio_manager_pulse) |
| - return; |
| - |
| +void GetAudioOutputDeviceNamesImpl(AudioManager* audio_manager) { |
| AudioDeviceNames device_names; |
| - audio_manager_pulse->GetAudioOutputDeviceNames(&device_names); |
| + audio_manager->GetAudioOutputDeviceNames(&device_names); |
| VLOG(2) << "Got " << device_names.size() << " audio output devices."; |
| for (AudioDeviceNames::iterator it = device_names.begin(); |
| @@ -32,6 +27,23 @@ TEST(AudioManagerTest, GetAudioOutputDeviceNames) { |
| VLOG(2) << "Device ID(" << it->unique_id << "), label: " << it->device_name; |
| } |
| } |
| + |
| +TEST(AudioManagerTest, GetAudioOutputDeviceNames) { |
| +#if defined(OS_LINUX) |
| + { |
| + VLOG(2) << "Testing AudioManagerPulse."; |
| + scoped_ptr<AudioManager> pulse_audio_manager(AudioManagerPulse::Create()); |
|
tommi (sloooow) - chröme
2013/09/04 13:43:29
What about:
scoped_ptr<AudioManager> audio_manager
Jói
2013/09/04 13:44:42
If I do that, I only get to test either pulseaudio
tommi (sloooow) - chröme
2013/09/04 14:32:51
OK, sounds good this way.
|
| + if (pulse_audio_manager.get()) |
| + GetAudioOutputDeviceNamesImpl(pulse_audio_manager.get()); |
| + else |
| + VLOG(2) << "No pulseaudio on this system."; |
| + } |
| + { |
| + VLOG(2) << "Testing AudioManagerLinux."; |
| + scoped_ptr<AudioManager> alsa_audio_manager(new AudioManagerLinux()); |
| + GetAudioOutputDeviceNamesImpl(alsa_audio_manager.get()); |
| + } |
| #endif // defined(OS_LINUX) |
| +} |
| } // namespace media |