2017-02-23 05:16:26 -08:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_processing/aec3/echo_path_variability.h"
|
2019-07-05 19:08:33 +02:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "test/gtest.h"
|
2017-02-23 05:16:26 -08:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
TEST(EchoPathVariability, CorrectBehavior) {
|
|
|
|
|
// Test correct passing and reporting of the gain change information.
|
2017-12-01 23:01:44 +01:00
|
|
|
EchoPathVariability v(
|
|
|
|
|
true, EchoPathVariability::DelayAdjustment::kNewDetectedDelay, false);
|
2017-02-23 05:16:26 -08:00
|
|
|
EXPECT_TRUE(v.gain_change);
|
2017-12-01 23:01:44 +01:00
|
|
|
EXPECT_TRUE(v.delay_change ==
|
|
|
|
|
EchoPathVariability::DelayAdjustment::kNewDetectedDelay);
|
2017-02-23 05:16:26 -08:00
|
|
|
EXPECT_TRUE(v.AudioPathChanged());
|
2017-12-01 23:01:44 +01:00
|
|
|
EXPECT_FALSE(v.clock_drift);
|
2017-02-23 05:16:26 -08:00
|
|
|
|
2017-12-01 23:01:44 +01:00
|
|
|
v = EchoPathVariability(true, EchoPathVariability::DelayAdjustment::kNone,
|
|
|
|
|
false);
|
2017-02-23 05:16:26 -08:00
|
|
|
EXPECT_TRUE(v.gain_change);
|
2017-12-01 23:01:44 +01:00
|
|
|
EXPECT_TRUE(v.delay_change == EchoPathVariability::DelayAdjustment::kNone);
|
2017-02-23 05:16:26 -08:00
|
|
|
EXPECT_TRUE(v.AudioPathChanged());
|
2017-12-01 23:01:44 +01:00
|
|
|
EXPECT_FALSE(v.clock_drift);
|
2017-02-23 05:16:26 -08:00
|
|
|
|
2017-12-01 23:01:44 +01:00
|
|
|
v = EchoPathVariability(
|
|
|
|
|
false, EchoPathVariability::DelayAdjustment::kNewDetectedDelay, false);
|
2017-02-23 05:16:26 -08:00
|
|
|
EXPECT_FALSE(v.gain_change);
|
2017-12-01 23:01:44 +01:00
|
|
|
EXPECT_TRUE(v.delay_change ==
|
|
|
|
|
EchoPathVariability::DelayAdjustment::kNewDetectedDelay);
|
2017-02-23 05:16:26 -08:00
|
|
|
EXPECT_TRUE(v.AudioPathChanged());
|
2017-12-01 23:01:44 +01:00
|
|
|
EXPECT_FALSE(v.clock_drift);
|
2017-02-23 05:16:26 -08:00
|
|
|
|
2017-12-01 23:01:44 +01:00
|
|
|
v = EchoPathVariability(false, EchoPathVariability::DelayAdjustment::kNone,
|
|
|
|
|
false);
|
2017-02-23 05:16:26 -08:00
|
|
|
EXPECT_FALSE(v.gain_change);
|
2017-12-01 23:01:44 +01:00
|
|
|
EXPECT_TRUE(v.delay_change == EchoPathVariability::DelayAdjustment::kNone);
|
2017-02-23 05:16:26 -08:00
|
|
|
EXPECT_FALSE(v.AudioPathChanged());
|
2017-12-01 23:01:44 +01:00
|
|
|
EXPECT_FALSE(v.clock_drift);
|
2017-02-23 05:16:26 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|