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

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

Issue 78033003: Adding device enumeration to Android device manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial support for BT detection Created 7 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/environment.h" 5 #include "base/environment.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "media/audio/audio_manager.h" 8 #include "media/audio/audio_manager.h"
9 #include "media/audio/audio_manager_base.h" 9 #include "media/audio/audio_manager_base.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 #endif 70 #endif
71 71
72 // Helper method which verifies that the device list starts with a valid 72 // Helper method which verifies that the device list starts with a valid
73 // default record followed by non-default device names. 73 // default record followed by non-default device names.
74 static void CheckDeviceNames(const AudioDeviceNames& device_names) { 74 static void CheckDeviceNames(const AudioDeviceNames& device_names) {
75 VLOG(2) << "Got " << device_names.size() << " audio devices."; 75 VLOG(2) << "Got " << device_names.size() << " audio devices.";
76 if (!device_names.empty()) { 76 if (!device_names.empty()) {
77 AudioDeviceNames::const_iterator it = device_names.begin(); 77 AudioDeviceNames::const_iterator it = device_names.begin();
78 78
79 VLOG(2) << "Device ID(" << it->unique_id
henrika (OOO until Aug 14) 2013/11/22 12:46:20 Temporary debugging only. Will be removed.
80 << "), label: " << it->device_name;
81
79 // The first device in the list should always be the default device. 82 // The first device in the list should always be the default device.
80 EXPECT_EQ(std::string(AudioManagerBase::kDefaultDeviceName), 83 EXPECT_EQ(std::string(AudioManagerBase::kDefaultDeviceName),
81 it->device_name); 84 it->device_name);
82 EXPECT_EQ(std::string(AudioManagerBase::kDefaultDeviceId), it->unique_id); 85 EXPECT_EQ(std::string(AudioManagerBase::kDefaultDeviceId), it->unique_id);
83 ++it; 86 ++it;
84 87
85 // Other devices should have non-empty name and id and should not contain 88 // Other devices should have non-empty name and id and should not contain
86 // default name or id. 89 // default name or id.
87 while (it != device_names.end()) { 90 while (it != device_names.end()) {
88 EXPECT_FALSE(it->device_name.empty()); 91 EXPECT_FALSE(it->device_name.empty());
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 VLOG(2) << it->unique_id << " matches with " << output_device_id; 339 VLOG(2) << it->unique_id << " matches with " << output_device_id;
337 found_an_associated_device = true; 340 found_an_associated_device = true;
338 } 341 }
339 } 342 }
340 343
341 EXPECT_TRUE(found_an_associated_device); 344 EXPECT_TRUE(found_an_associated_device);
342 #endif // defined(OS_WIN) || defined(OS_MACOSX) 345 #endif // defined(OS_WIN) || defined(OS_MACOSX)
343 } 346 }
344 347
345 } // namespace media 348 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698