2013-01-29 12:09:21 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2012 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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// Unit tests for DelayManager class.
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_coding/neteq/delay_manager.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
|
2024-10-07 13:02:08 +00:00
|
|
|
#include "api/neteq/tick_timer.h"
|
2024-08-13 15:28:50 +02:00
|
|
|
#include "test/explicit_key_value_config.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "test/gtest.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
2019-02-27 10:08:09 +01:00
|
|
|
namespace {
|
2024-08-13 15:28:50 +02:00
|
|
|
|
|
|
|
|
using test::ExplicitKeyValueConfig;
|
|
|
|
|
|
2024-10-07 13:02:08 +00:00
|
|
|
TEST(DelayManagerTest, UpdateNormal) {
|
|
|
|
|
TickTimer tick_timer;
|
|
|
|
|
DelayManager dm(DelayManager::Config(ExplicitKeyValueConfig("")),
|
|
|
|
|
&tick_timer);
|
2021-11-09 12:58:45 +01:00
|
|
|
for (int i = 0; i < 50; ++i) {
|
2024-10-07 13:02:08 +00:00
|
|
|
dm.Update(0, false);
|
|
|
|
|
tick_timer.Increment(2);
|
2021-11-09 12:58:45 +01:00
|
|
|
}
|
2024-10-07 13:02:08 +00:00
|
|
|
EXPECT_EQ(20, dm.TargetDelayMs());
|
2019-08-22 15:00:16 +02:00
|
|
|
}
|
|
|
|
|
|
2024-10-07 13:02:08 +00:00
|
|
|
} // namespace
|
2013-01-29 12:09:21 +00:00
|
|
|
} // namespace webrtc
|