| 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 38269bc35d9529404d4b008478c42875a2c414e6..4b04f98c488a39d3f5e1cfc9ee2dace55ea2d0fe 100644
|
| --- a/media/audio/android/audio_android_unittest.cc
|
| +++ b/media/audio/android/audio_android_unittest.cc
|
| @@ -87,41 +87,6 @@ static double ExpectedTimeBetweenCallbacks(AudioParameters params) {
|
| static_cast<double>(params.sample_rate()))).InMillisecondsF();
|
| }
|
|
|
| -// Helper method which verifies that the device list starts with a valid
|
| -// default device name followed by non-default device names.
|
| -static void CheckDeviceNames(const AudioDeviceNames& device_names) {
|
| - DVLOG(2) << "Got " << device_names.size() << " audio devices.";
|
| - if (device_names.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.
|
| - LOG(WARNING) << "No input devices detected";
|
| - return;
|
| - }
|
| -
|
| - AudioDeviceNames::const_iterator it = device_names.begin();
|
| -
|
| - // The first device in the list should always be the default device.
|
| - EXPECT_EQ(std::string(AudioManagerBase::kDefaultDeviceName),
|
| - it->device_name);
|
| - EXPECT_EQ(std::string(AudioManagerBase::kDefaultDeviceId), it->unique_id);
|
| - ++it;
|
| -
|
| - // Other devices should have non-empty name and id and should not contain
|
| - // default name or id.
|
| - while (it != device_names.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_NE(std::string(AudioManagerBase::kDefaultDeviceName),
|
| - it->device_name);
|
| - EXPECT_NE(std::string(AudioManagerBase::kDefaultDeviceId),
|
| - it->unique_id);
|
| - ++it;
|
| - }
|
| -}
|
| -
|
| // We clear the data bus to ensure that the test does not cause noise.
|
| static int RealOnMoreData(AudioBus* dest, uint32 total_bytes_delay) {
|
| dest->Zero();
|
| @@ -552,6 +517,38 @@ class AudioAndroidOutputTest : public testing::Test {
|
| audio_output_stream_ = NULL;
|
| }
|
|
|
| + // 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()) {
|
| + // 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.
|
| + LOG(WARNING) << "No input devices detected";
|
| + return;
|
| + }
|
| +
|
| + AudioDeviceNames::const_iterator it = device_names.begin();
|
| +
|
| + // The first device in the list should always be the default device.
|
| + EXPECT_EQ(audio_manager()->GetDefaultDeviceName(), it->device_name);
|
| + EXPECT_EQ(std::string(AudioManagerBase::kDefaultDeviceId), it->unique_id);
|
| + ++it;
|
| +
|
| + // Other devices should have non-empty name and id and should not contain
|
| + // default name or id.
|
| + while (it != device_names.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_NE(audio_manager()->GetDefaultDeviceName(), it->device_name);
|
| + EXPECT_NE(std::string(AudioManagerBase::kDefaultDeviceId), it->unique_id);
|
| + ++it;
|
| + }
|
| + }
|
| +
|
| scoped_ptr<base::MessageLoopForUI> loop_;
|
| scoped_ptr<AudioManager> audio_manager_;
|
| AudioParameters audio_output_parameters_;
|
|
|