OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/logging.h" |
| 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "media/audio/audio_manager.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 |
| 10 #if defined(USE_PULSEAUDIO) |
| 11 #include "media/audio/pulse/audio_manager_pulse.h" |
| 12 #endif |
| 13 |
| 14 namespace media { |
| 15 |
| 16 // TODO(joi): Remove guards once implemented for all platforms. |
| 17 TEST(AudioManagerTest, GetAudioOutputDeviceNames) { |
| 18 #if defined(USE_PULSEAUDIO) |
| 19 scoped_ptr<AudioManager> audio_manager_pulse(AudioManagerPulse::Create()); |
| 20 if (!audio_manager_pulse) |
| 21 return; |
| 22 |
| 23 AudioDeviceNames device_names; |
| 24 audio_manager_pulse->GetAudioOutputDeviceNames(&device_names); |
| 25 |
| 26 VLOG(2) << "Got " << device_names.size() << " audio output devices."; |
| 27 for (AudioDeviceNames::iterator it = device_names.begin(); |
| 28 it != device_names.end(); |
| 29 ++it) { |
| 30 EXPECT_FALSE(it->unique_id.empty()); |
| 31 EXPECT_FALSE(it->device_name.empty()); |
| 32 VLOG(2) << "Device ID(" << it->unique_id << "), label: " << it->device_name; |
| 33 } |
| 34 #endif // defined(USE_PULSEAUDIO) |
| 35 } |
| 36 |
| 37 } // namespace media |
OLD | NEW |