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

Unified Diff: media/audio/audio_system_impl_unittest.cc

Issue 2763383002: Switching AudioInputDeviceManager from using AudioManager interface to AudioSystem one. (Closed)
Patch Set: Created 3 years, 9 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
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..113f3e4901bd337d0758543fda16b4975ce32ad0 100644
--- a/media/audio/audio_system_impl_unittest.cc
+++ b/media/audio/audio_system_impl_unittest.cc
@@ -125,6 +125,7 @@ class AudioSystemImplTest : public testing::TestWithParam<bool> {
MOCK_METHOD0(AudioParametersReceived, void(void));
MOCK_METHOD1(HasInputDevicesCallback, void(bool));
MOCK_METHOD0(DeviceDescriptionsReceived, void(void));
+ MOCK_METHOD1(AssociatedOutputDeviceIDReceived, void(const std::string&));
protected:
base::MessageLoop message_loop_;
@@ -132,7 +133,7 @@ class AudioSystemImplTest : public testing::TestWithParam<bool> {
bool use_audio_thread_;
base::Thread audio_thread_;
MockAudioManager::UniquePtr audio_manager_;
- std::unique_ptr<media::AudioSystem> audio_system_;
+ AudioSystem::UniquePtr audio_system_;
AudioParameters input_params_;
AudioParameters output_params_;
AudioParameters default_output_params_;
@@ -268,6 +269,22 @@ TEST_P(AudioSystemImplTest, GetOutputDeviceDescriptions) {
WaitForCallback();
}
+TEST_P(AudioSystemImplTest, GetAssociatedOutputDeviceID) {
+ const std::string associated_id("associated_id");
+ audio_manager_->SetAssociatedOutputDeviceIDCallback(
+ base::Bind([](const std::string& result,
+ const std::string&) -> std::string { return result; },
+ associated_id));
+
+ EXPECT_CALL(*this, AssociatedOutputDeviceIDReceived(associated_id));
+
+ audio_system_->GetAssociatedOutputDeviceID(
+ std::string(),
+ base::Bind(&AudioSystemImplTest::AssociatedOutputDeviceIDReceived,
+ base::Unretained(this)));
+ WaitForCallback();
+}
+
INSTANTIATE_TEST_CASE_P(, AudioSystemImplTest, testing::Values(false, true));
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698