Chromium Code Reviews| Index: media/audio/audio_input_device_unittest.cc |
| =================================================================== |
| --- media/audio/audio_input_device_unittest.cc (revision 0) |
| +++ media/audio/audio_input_device_unittest.cc (revision 0) |
| @@ -0,0 +1,29 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "base/logging.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "media/audio/audio_manager.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +// Test that devices can be enumerated. |
|
awong
2011/05/23 21:17:58
I'm going to be a bit picky about this. The comme
|
| +TEST(AudioInputDeviceTest, EnumerateDevices) { |
| + AudioDeviceNames device_names; |
| + ASSERT_TRUE(AudioManager::GetAudioManager() != NULL); |
| + AudioManager::GetAudioManager()->GetAudioInputDeviceNames(&device_names); |
| + if (!device_names.empty()) { |
| + AudioDeviceNames::const_iterator it = device_names.begin(); |
| + // The first device in the list is the prepended default device. |
| + EXPECT_EQ("Default", it->device_name); |
| + EXPECT_EQ("Default_0", it->unique_id); |
| + ++it; |
| + |
| + // Other devices should have non-empty name and id. |
| + while (it != device_names.end()) { |
| + EXPECT_EQ("", it->device_name); |
| + EXPECT_EQ("", it->unique_id); |
| + ++it; |
| + } |
| + } |
| +} |
| Property changes on: media/audio/audio_input_device_unittest.cc |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |