peah | e985b3f | 2017-03-01 06:08:53 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 11 | #include "modules/audio_processing/aec3/render_delay_controller_metrics.h" |
Jonas Olsson | a4d8737 | 2019-07-05 17:08:33 | [diff] [blame] | 12 | |
Danil Chapovalov | db9f7ab | 2018-06-19 08:50:11 | [diff] [blame] | 13 | #include "absl/types/optional.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 14 | #include "modules/audio_processing/aec3/aec3_common.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 15 | #include "test/gtest.h" |
peah | e985b3f | 2017-03-01 06:08:53 | [diff] [blame] | 16 | |
| 17 | namespace webrtc { |
| 18 | |
| 19 | // Verify the general functionality of RenderDelayControllerMetrics. |
| 20 | TEST(RenderDelayControllerMetrics, NormalUsage) { |
| 21 | RenderDelayControllerMetrics metrics; |
| 22 | |
| 23 | for (int j = 0; j < 3; ++j) { |
| 24 | for (int k = 0; k < kMetricsReportingIntervalBlocks - 1; ++k) { |
Gustaf Ullberg | 777cf26 | 2018-11-22 15:02:34 | [diff] [blame] | 25 | metrics.Update(absl::nullopt, 0, absl::nullopt, |
| 26 | ClockdriftDetector::Level::kNone); |
peah | e985b3f | 2017-03-01 06:08:53 | [diff] [blame] | 27 | EXPECT_FALSE(metrics.MetricsReported()); |
| 28 | } |
Gustaf Ullberg | 777cf26 | 2018-11-22 15:02:34 | [diff] [blame] | 29 | metrics.Update(absl::nullopt, 0, absl::nullopt, |
| 30 | ClockdriftDetector::Level::kNone); |
peah | e985b3f | 2017-03-01 06:08:53 | [diff] [blame] | 31 | EXPECT_TRUE(metrics.MetricsReported()); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | } // namespace webrtc |