| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011 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 "media/audio/audio_manager.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 |
| 8 // Test that devices can be enumerated. |
| 9 TEST(AudioInputDeviceTest, EnumerateDevices) { |
| 10 media::AudioDeviceNames device_names; |
| 11 ASSERT_TRUE(AudioManager::GetAudioManager() != NULL); |
| 12 AudioManager::GetAudioManager()->GetAudioInputDeviceNames( |
| 13 &device_names); |
| 14 if (!device_names.empty()) { |
| 15 media::AudioDeviceNames::const_iterator it = device_names.begin(); |
| 16 // The first device in the list is the prepended default device. |
| 17 EXPECT_EQ("Default", it->device_name); |
| 18 EXPECT_EQ("Default_0", it->unique_id); |
| 19 ++it; |
| 20 |
| 21 // Other devices should have non-empty name and id. |
| 22 while (it != device_names.end()) { |
| 23 EXPECT_EQ("", it->device_name); |
| 24 EXPECT_EQ("", it->unique_id); |
| 25 ++it; |
| 26 } |
| 27 } |
| 28 } |
| OLD | NEW |