Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1202)

Unified Diff: media/audio/audio_input_device_unittest.cc

Issue 7060011: Adding GetAudioInputDeviceNames to AudioManager, this function is supposed to do device enumerati... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/audio_device_name.h ('k') | media/audio/audio_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,32 @@
+// 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 "media/audio/audio_manager.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace media {
+
+// Test that devices can be enumerated.
+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("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;
+ }
+ }
+}
+
+} // namespace media
Property changes on: media/audio/audio_input_device_unittest.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « media/audio/audio_device_name.h ('k') | media/audio/audio_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698