Modify some tests to never use DTX disable mode

DTX disable mode will be removed as a part of the ACM redesign work.

COAUTHOR:kwiberg@webrtc.org

R=henrika@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/34769004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@8125 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org 2015-01-22 13:30:58 +00:00
parent e5251ad63c
commit 043db24767
3 changed files with 11 additions and 8 deletions

View File

@ -141,8 +141,8 @@ void TestVADDTX::runTestCases() {
Run();
VerifyTest();
// #5 DTX = ON, VAD = OFF, VADNormal
SetVAD(true, false, VADNormal);
// #5 DTX = ON, VAD = ON, VADNormal
SetVAD(true, true, VADNormal);
Run();
VerifyTest();
}

View File

@ -10,6 +10,7 @@
#include "webrtc/voice_engine/channel.h"
#include "webrtc/base/checks.h"
#include "webrtc/base/format_macros.h"
#include "webrtc/base/timeutils.h"
#include "webrtc/common.h"
@ -1352,6 +1353,7 @@ Channel::SetVADStatus(bool enableVAD, ACMVADMode mode, bool disableDTX)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::SetVADStatus(mode=%d)", mode);
DCHECK(!(disableDTX && enableVAD)) << "disableDTX mode is deprecated";
// To disable VAD, DTX must be disabled too
disableDTX = ((enableVAD == false) ? true : disableDTX);
if (audio_coding_->SetVAD(!disableDTX, enableVAD, mode) != 0)

View File

@ -97,16 +97,17 @@ TEST_F(CodecTest, VoiceActivityDetectionTypeSettingsCanBeChanged) {
EXPECT_EQ(vad_mode, webrtc::kVadAggressiveMid);
EXPECT_FALSE(dtx_disabled);
// The fourth argument is the DTX disable flag.
EXPECT_EQ(0, voe_codec_->SetVADStatus(
channel_, true, webrtc::kVadAggressiveHigh, true));
// The fourth argument is the DTX disable flag, which is always supposed to
// be false.
EXPECT_EQ(0, voe_codec_->SetVADStatus(channel_, true,
webrtc::kVadAggressiveHigh, false));
EXPECT_EQ(0, voe_codec_->GetVADStatus(
channel_, vad_enabled, vad_mode, dtx_disabled));
EXPECT_EQ(vad_mode, webrtc::kVadAggressiveHigh);
EXPECT_TRUE(dtx_disabled);
EXPECT_FALSE(dtx_disabled);
EXPECT_EQ(0, voe_codec_->SetVADStatus(
channel_, true, webrtc::kVadConventional, true));
EXPECT_EQ(0, voe_codec_->SetVADStatus(channel_, true,
webrtc::kVadConventional, false));
EXPECT_EQ(0, voe_codec_->GetVADStatus(
channel_, vad_enabled, vad_mode, dtx_disabled));
EXPECT_EQ(vad_mode, webrtc::kVadConventional);