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

Unified Diff: media/audio/audio_system_impl_unittest.cc

Issue 2801983003: Switching WebRTC browser test from AudioManager::HasAudioOutputDevices() to AudioSystem interface. (Closed)
Patch Set: moved HasAudioOutputDevices() to WebRtcContentBrowserTestBase Created 3 years, 8 months 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 | « media/audio/audio_system_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_system_impl_unittest.cc
diff --git a/media/audio/audio_system_impl_unittest.cc b/media/audio/audio_system_impl_unittest.cc
index 26f19873b429029da9ed76986fd47464ee278d3b..76f036b13bc2d414bf7c3dacd896303f6077c7ef 100644
--- a/media/audio/audio_system_impl_unittest.cc
+++ b/media/audio/audio_system_impl_unittest.cc
@@ -98,6 +98,11 @@ class AudioSystemImplTest : public testing::TestWithParam<bool> {
HasInputDevicesCallback(result);
}
+ void OnHasOutputDevices(bool result) {
+ EXPECT_TRUE(thread_checker_.CalledOnValidThread());
+ HasOutputDevicesCallback(result);
+ }
+
void OnGetDeviceDescriptions(
const AudioDeviceDescriptions& expected_descriptions,
AudioDeviceDescriptions descriptions) {
@@ -124,6 +129,7 @@ class AudioSystemImplTest : public testing::TestWithParam<bool> {
// Mocks to verify that AudioSystem replied with an expected callback.
MOCK_METHOD0(AudioParametersReceived, void(void));
MOCK_METHOD1(HasInputDevicesCallback, void(bool));
+ MOCK_METHOD1(HasOutputDevicesCallback, void(bool));
MOCK_METHOD0(DeviceDescriptionsReceived, void(void));
protected:
@@ -208,6 +214,21 @@ TEST_P(AudioSystemImplTest, HasNoInputDevices) {
WaitForCallback();
}
+TEST_P(AudioSystemImplTest, HasOutputDevices) {
+ EXPECT_CALL(*this, HasOutputDevicesCallback(true));
+ audio_system_->HasOutputDevices(base::Bind(
+ &AudioSystemImplTest::OnHasOutputDevices, base::Unretained(this)));
+ WaitForCallback();
+}
+
+TEST_P(AudioSystemImplTest, HasNoOutputDevices) {
+ audio_manager_->SetHasOutputDevices(false);
+ EXPECT_CALL(*this, HasOutputDevicesCallback(false));
+ audio_system_->HasOutputDevices(base::Bind(
+ &AudioSystemImplTest::OnHasOutputDevices, base::Unretained(this)));
+ WaitForCallback();
+}
+
TEST_P(AudioSystemImplTest, GetInputDeviceDescriptionsNoInputDevices) {
output_device_descriptions_.emplace_back("output_device_name",
"output_device_id", "group_id");
« no previous file with comments | « media/audio/audio_system_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698