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

Side by Side Diff: media/audio/audio_input_device_unittest.cc

Issue 8491044: Link things together and enable the device selection for linux and mac. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: rebase2 Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/audio/audio_input_controller.cc ('k') | media/audio/audio_input_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/audio/audio_manager.h" 5 #include "media/audio/audio_manager_base.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 namespace media { 8 namespace media {
9 9
10 // Test that devices can be enumerated. 10 // Test that devices can be enumerated.
11 TEST(AudioInputDeviceTest, EnumerateDevices) { 11 TEST(AudioInputDeviceTest, EnumerateDevices) {
12 AudioDeviceNames device_names; 12 AudioDeviceNames device_names;
13 ASSERT_TRUE(AudioManager::GetAudioManager() != NULL); 13 ASSERT_TRUE(AudioManager::GetAudioManager() != NULL);
14 AudioManager::GetAudioManager()->GetAudioInputDeviceNames( 14 AudioManager::GetAudioManager()->GetAudioInputDeviceNames(
15 &device_names); 15 &device_names);
16 if (!device_names.empty()) { 16 if (!device_names.empty()) {
17 AudioDeviceNames::const_iterator it = device_names.begin(); 17 AudioDeviceNames::const_iterator it = device_names.begin();
18 // The first device in the list is the prepended default device. 18 // The first device in the list is the prepended default device.
19 EXPECT_EQ("Default", it->device_name); 19 EXPECT_EQ(std::string(AudioManagerBase::kDefaultDeviceName),
20 EXPECT_EQ("0", it->unique_id); 20 it->device_name);
21 EXPECT_EQ(std::string(AudioManagerBase::kDefaultDeviceId), it->unique_id);
21 ++it; 22 ++it;
22 23
23 // Other devices should have non-empty name and id. 24 // Other devices should have non-empty name and id.
24 while (it != device_names.end()) { 25 while (it != device_names.end()) {
25 EXPECT_NE("", it->device_name); 26 EXPECT_NE("", it->device_name);
26 EXPECT_NE("", it->unique_id); 27 EXPECT_NE("", it->unique_id);
27 ++it; 28 ++it;
28 } 29 }
29 } 30 }
30 } 31 }
31 32
32 } // namespace media 33 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_input_controller.cc ('k') | media/audio/audio_input_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698