OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 #else | 116 #else |
117 EXPECT_TRUE(gc->is_enabled()); | 117 EXPECT_TRUE(gc->is_enabled()); |
118 EXPECT_EQ(GainControl::kAdaptiveAnalog, gc->mode()); | 118 EXPECT_EQ(GainControl::kAdaptiveAnalog, gc->mode()); |
119 #endif | 119 #endif |
120 } | 120 } |
121 | 121 |
122 TEST(ApmHelpersTest, AgcStatus_EnableDisable) { | 122 TEST(ApmHelpersTest, AgcStatus_EnableDisable) { |
123 TestHelper helper; | 123 TestHelper helper; |
124 GainControl* gc = helper.apm()->gain_control(); | 124 GainControl* gc = helper.apm()->gain_control(); |
125 #if defined(WEBRTC_IOS) || defined(WEBRTC_ANDROID) | 125 #if defined(WEBRTC_IOS) || defined(WEBRTC_ANDROID) |
126 apm_helpers::SetAgcStatus(helper.apm(), helper.adm(), false, | 126 apm_helpers::SetAgcStatus(helper.apm(), helper.adm(), false); |
127 kAgcFixedDigital); | |
128 EXPECT_FALSE(gc->is_enabled()); | 127 EXPECT_FALSE(gc->is_enabled()); |
129 EXPECT_EQ(GainControl::kFixedDigital, gc->mode()); | 128 EXPECT_EQ(GainControl::kFixedDigital, gc->mode()); |
130 | 129 |
131 apm_helpers::SetAgcStatus(helper.apm(), helper.adm(), true, | 130 apm_helpers::SetAgcStatus(helper.apm(), helper.adm(), true); |
132 kAgcFixedDigital); | |
133 EXPECT_TRUE(gc->is_enabled()); | 131 EXPECT_TRUE(gc->is_enabled()); |
134 EXPECT_EQ(GainControl::kFixedDigital, gc->mode()); | 132 EXPECT_EQ(GainControl::kFixedDigital, gc->mode()); |
135 #else | 133 #else |
136 EXPECT_CALL(*helper.adm(), SetAGC(false)).WillOnce(testing::Return(0)); | 134 EXPECT_CALL(*helper.adm(), SetAGC(false)).WillOnce(testing::Return(0)); |
137 apm_helpers::SetAgcStatus(helper.apm(), helper.adm(), false, | 135 apm_helpers::SetAgcStatus(helper.apm(), helper.adm(), false); |
138 kAgcAdaptiveAnalog); | |
139 EXPECT_FALSE(gc->is_enabled()); | 136 EXPECT_FALSE(gc->is_enabled()); |
140 EXPECT_EQ(GainControl::kAdaptiveAnalog, gc->mode()); | 137 EXPECT_EQ(GainControl::kAdaptiveAnalog, gc->mode()); |
141 | 138 |
142 EXPECT_CALL(*helper.adm(), SetAGC(true)).WillOnce(testing::Return(0)); | 139 EXPECT_CALL(*helper.adm(), SetAGC(true)).WillOnce(testing::Return(0)); |
143 apm_helpers::SetAgcStatus(helper.apm(), helper.adm(), true, | 140 apm_helpers::SetAgcStatus(helper.apm(), helper.adm(), true); |
144 kAgcAdaptiveAnalog); | |
145 EXPECT_TRUE(gc->is_enabled()); | 141 EXPECT_TRUE(gc->is_enabled()); |
146 EXPECT_EQ(GainControl::kAdaptiveAnalog, gc->mode()); | 142 EXPECT_EQ(GainControl::kAdaptiveAnalog, gc->mode()); |
147 #endif | 143 #endif |
148 } | 144 } |
149 | 145 |
150 TEST(ApmHelpersTest, EcStatus_DefaultMode) { | 146 TEST(ApmHelpersTest, EcStatus_DefaultMode) { |
151 TestHelper helper; | 147 TestHelper helper; |
152 EchoCancellation* ec = helper.apm()->echo_cancellation(); | 148 EchoCancellation* ec = helper.apm()->echo_cancellation(); |
153 EchoControlMobile* ecm = helper.apm()->echo_control_mobile(); | 149 EchoControlMobile* ecm = helper.apm()->echo_control_mobile(); |
154 EXPECT_FALSE(ec->is_enabled()); | 150 EXPECT_FALSE(ec->is_enabled()); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 // TODO(solenberg): Move this test to a better place - added here for the sake | 275 // TODO(solenberg): Move this test to a better place - added here for the sake |
280 // of duplicating all relevant tests from audio_processing_test.cc. | 276 // of duplicating all relevant tests from audio_processing_test.cc. |
281 TEST(ApmHelpersTest, StereoSwapping_EnableDisable) { | 277 TEST(ApmHelpersTest, StereoSwapping_EnableDisable) { |
282 TestHelper helper; | 278 TestHelper helper; |
283 helper.transmit_mixer()->EnableStereoChannelSwapping(true); | 279 helper.transmit_mixer()->EnableStereoChannelSwapping(true); |
284 EXPECT_TRUE(helper.transmit_mixer()->IsStereoChannelSwappingEnabled()); | 280 EXPECT_TRUE(helper.transmit_mixer()->IsStereoChannelSwappingEnabled()); |
285 helper.transmit_mixer()->EnableStereoChannelSwapping(false); | 281 helper.transmit_mixer()->EnableStereoChannelSwapping(false); |
286 EXPECT_FALSE(helper.transmit_mixer()->IsStereoChannelSwappingEnabled()); | 282 EXPECT_FALSE(helper.transmit_mixer()->IsStereoChannelSwappingEnabled()); |
287 } | 283 } |
288 } // namespace webrtc | 284 } // namespace webrtc |
OLD | NEW |