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

Unified Diff: media/audio/android/audio_android_unittest.cc

Issue 2563653002: Replace AudioManager::GetAudio*DeviceNames with AudioManager::GetAudio*DeviceDescriptions (Closed)
Patch Set: nit fixes Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/media/media_devices.cc ('k') | media/audio/audio_device_description.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/android/audio_android_unittest.cc
diff --git a/media/audio/android/audio_android_unittest.cc b/media/audio/android/audio_android_unittest.cc
index b883d13afe799d615c3fb2142d47155740183a97..d5ca8c9163a79f937ce92fe63776df6eb58eb751 100644
--- a/media/audio/android/audio_android_unittest.cc
+++ b/media/audio/android/audio_android_unittest.cc
@@ -93,9 +93,10 @@ double ExpectedTimeBetweenCallbacks(AudioParameters params) {
// Helper method which verifies that the device list starts with a valid
// default device name followed by non-default device names.
-void CheckDeviceNames(const AudioDeviceNames& device_names) {
- DVLOG(2) << "Got " << device_names.size() << " audio devices.";
- if (device_names.empty()) {
+void CheckDeviceDescriptions(
+ const AudioDeviceDescriptions& device_descriptions) {
+ DVLOG(2) << "Got " << device_descriptions.size() << " audio devices.";
+ if (device_descriptions.empty()) {
// Log a warning so we can see the status on the build bots. No need to
// break the test though since this does successfully test the code and
// some failure cases.
@@ -103,7 +104,7 @@ void CheckDeviceNames(const AudioDeviceNames& device_names) {
return;
}
- AudioDeviceNames::const_iterator it = device_names.begin();
+ AudioDeviceDescriptions::const_iterator it = device_descriptions.begin();
// The first device in the list should always be the default device.
EXPECT_EQ(AudioDeviceDescription::GetDefaultDeviceName(), it->device_name);
@@ -113,11 +114,12 @@ void CheckDeviceNames(const AudioDeviceNames& device_names) {
// Other devices should have non-empty name and id and should not contain
// default name or id.
- while (it != device_names.end()) {
+ while (it != device_descriptions.end()) {
EXPECT_FALSE(it->device_name.empty());
EXPECT_FALSE(it->unique_id.empty());
- DVLOG(2) << "Device ID(" << it->unique_id
- << "), label: " << it->device_name;
+ EXPECT_FALSE(it->group_id.empty());
+ DVLOG(2) << "Device ID(" << it->unique_id << "), label: " << it->device_name
+ << " group: " << it->group_id;
EXPECT_NE(AudioDeviceDescription::GetDefaultDeviceName(), it->device_name);
EXPECT_NE(std::string(AudioDeviceDescription::kDefaultDeviceId),
it->unique_id);
@@ -739,25 +741,21 @@ TEST_F(AudioAndroidOutputTest, GetDefaultOutputStreamParameters) {
}
// Verify input device enumeration.
-TEST_F(AudioAndroidInputTest, GetAudioInputDeviceNames) {
+TEST_F(AudioAndroidInputTest, GetAudioInputDeviceDescriptions) {
ABORT_AUDIO_TEST_IF_NOT(audio_manager()->HasAudioInputDevices());
- AudioDeviceNames devices;
- RunOnAudioThread(
- base::Bind(&AudioManager::GetAudioInputDeviceNames,
- base::Unretained(audio_manager()),
- &devices));
- CheckDeviceNames(devices);
+ AudioDeviceDescriptions devices;
+ RunOnAudioThread(base::Bind(&AudioManager::GetAudioInputDeviceDescriptions,
+ base::Unretained(audio_manager()), &devices));
+ CheckDeviceDescriptions(devices);
}
// Verify output device enumeration.
-TEST_F(AudioAndroidOutputTest, GetAudioOutputDeviceNames) {
+TEST_F(AudioAndroidOutputTest, GetAudioOutputDeviceDescriptions) {
ABORT_AUDIO_TEST_IF_NOT(audio_manager()->HasAudioOutputDevices());
- AudioDeviceNames devices;
- RunOnAudioThread(
- base::Bind(&AudioManager::GetAudioOutputDeviceNames,
- base::Unretained(audio_manager()),
- &devices));
- CheckDeviceNames(devices);
+ AudioDeviceDescriptions devices;
+ RunOnAudioThread(base::Bind(&AudioManager::GetAudioOutputDeviceDescriptions,
+ base::Unretained(audio_manager()), &devices));
+ CheckDeviceDescriptions(devices);
}
// Ensure that a default input stream can be created and closed.
« no previous file with comments | « content/common/media/media_devices.cc ('k') | media/audio/audio_device_description.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698