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

Unified Diff: webrtc/modules/audio_device/android/audio_manager_unittest.cc

Issue 2411263003: Android audio playout now supports non-call media streams (Closed)
Patch Set: Adding support for SetCommunicationMode in AudioManager Created 4 years, 2 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: webrtc/modules/audio_device/android/audio_manager_unittest.cc
diff --git a/webrtc/modules/audio_device/android/audio_manager_unittest.cc b/webrtc/modules/audio_device/android/audio_manager_unittest.cc
index 250797652270c22f8d505fa26254b27dd473b756..cb04beff766f791e71a56572bb6aa0399fcfaa12 100644
--- a/webrtc/modules/audio_device/android/audio_manager_unittest.cc
+++ b/webrtc/modules/audio_device/android/audio_manager_unittest.cc
@@ -35,6 +35,11 @@ class AudioManagerTest : public ::testing::Test {
record_parameters_ = audio_manager()->GetRecordAudioParameters();
}
+ virtual ~AudioManagerTest() {
+ // Always ensure that we restore default/normal mode after the test.
+ audio_manager()->SetCommunicationMode(false);
+ }
+
AudioManager* audio_manager() const { return audio_manager_.get(); }
// A valid audio layer must always be set before calling Init(), hence we
@@ -107,6 +112,14 @@ TEST_F(AudioManagerTest, InitClose) {
EXPECT_TRUE(audio_manager()->Close());
}
+// Verify communication mode functionality.
+TEST_F(AudioManagerTest, CommunicationMode) {
+ audio_manager()->SetCommunicationMode(true);
+ EXPECT_TRUE(audio_manager()->IsCommunicationModeEnabled());
+ audio_manager()->SetCommunicationMode(false);
+ EXPECT_FALSE(audio_manager()->IsCommunicationModeEnabled());
+}
+
TEST_F(AudioManagerTest, IsAcousticEchoCancelerSupported) {
PRINT("%sAcoustic Echo Canceler support: %s\n", kTag,
audio_manager()->IsAcousticEchoCancelerSupported() ? "Yes" : "No");

Powered by Google App Engine
This is Rietveld 408576698