Chromium Code Reviews
|
| 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 "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 TEST(AudioInputDeviceTest, EnumerateDevices) { | |
|
awong
2011/05/23 17:36:15
Add a 1-line (keep it very short) comment explaini
xians
2011/05/23 20:15:59
Done.
| |
| 11 AudioInputDeviceNames device_names; | |
| 12 ASSERT_TRUE(AudioManager::GetAudioManager() != NULL); | |
| 13 AudioManager::GetAudioManager()->GetAudioInputDeviceNames(&device_names); | |
|
awong
2011/05/23 17:36:15
This looks like it's going to actually query ALSA
xians
2011/05/23 20:15:59
True. I changed the test to handle the case when t
awong
2011/05/23 21:17:58
Would it be possible to mock out the Alsa response
| |
| 14 ASSERT_FALSE(device_names.empty()); | |
| 15 int i(0); | |
|
awong
2011/05/23 17:36:15
Most code in Chromium doesn't use the constructor
xians
2011/05/23 20:15:59
Done.
| |
| 16 for (AudioInputDeviceNames::iterator it = device_names.begin(); | |
| 17 it != device_names.end(); | |
| 18 ++i, ++it) { | |
| 19 if (i == 0) { | |
| 20 EXPECT_EQ("Default", it->device_name); | |
| 21 EXPECT_EQ("Default_0", it->unique_id); | |
| 22 } else { | |
| 23 EXPECT_NE("", it->device_name); | |
| 24 EXPECT_NE("", it->unique_id); | |
| 25 } | |
| 26 DLOG(INFO) << i << " Device Name: " << it->device_name; | |
|
awong
2011/05/23 17:36:15
Don't unconditionally dump output inside a unittes
xians
2011/05/23 20:15:59
Done.
| |
| 27 DLOG(INFO) << " Device Id: " << it->unique_id; | |
| 28 } | |
| 29 | |
| 30 device_names.clear(); | |
|
awong
2011/05/23 17:36:15
device_names is a temporary...no reason to expicit
xians
2011/05/23 20:15:59
Done.
| |
| 31 } | |
| OLD | NEW |