peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016 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 06:47:31 +0200 | [diff] [blame] | 11 | #include "modules/audio_processing/aec3/echo_canceller3.h" |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 12 | |
| 13 | #include <deque> |
| 14 | #include <memory> |
| 15 | #include <sstream> |
| 16 | #include <string> |
| 17 | #include <utility> |
| 18 | #include <vector> |
| 19 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 20 | #include "modules/audio_processing/aec3/aec3_common.h" |
| 21 | #include "modules/audio_processing/aec3/block_processor.h" |
| 22 | #include "modules/audio_processing/aec3/frame_blocker.h" |
| 23 | #include "modules/audio_processing/aec3/mock/mock_block_processor.h" |
| 24 | #include "modules/audio_processing/audio_buffer.h" |
| 25 | #include "test/gmock.h" |
| 26 | #include "test/gtest.h" |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 27 | |
| 28 | namespace webrtc { |
| 29 | namespace { |
| 30 | |
| 31 | using testing::StrictMock; |
| 32 | using testing::_; |
| 33 | |
| 34 | // Populates the frame with linearly increasing sample values for each band, |
| 35 | // with a band-specific offset, in order to allow simple bitexactness |
| 36 | // verification for each band. |
| 37 | void PopulateInputFrame(size_t frame_length, |
| 38 | size_t num_bands, |
| 39 | size_t frame_index, |
| 40 | float* const* frame, |
| 41 | int offset) { |
| 42 | for (size_t k = 0; k < num_bands; ++k) { |
| 43 | for (size_t i = 0; i < frame_length; ++i) { |
| 44 | float value = static_cast<int>(frame_index * frame_length + i) + offset; |
| 45 | frame[k][i] = (value > 0 ? 5000 * k + value : 0); |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 50 | // Populates the frame with linearly increasing sample values. |
| 51 | void PopulateInputFrame(size_t frame_length, |
| 52 | size_t frame_index, |
| 53 | float* frame, |
| 54 | int offset) { |
| 55 | for (size_t i = 0; i < frame_length; ++i) { |
| 56 | float value = static_cast<int>(frame_index * frame_length + i) + offset; |
| 57 | frame[i] = std::max(value, 0.f); |
| 58 | } |
| 59 | } |
| 60 | |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 61 | // Verifies the that samples in the output frame are identical to the samples |
| 62 | // that were produced for the input frame, with an offset in order to compensate |
| 63 | // for buffering delays. |
| 64 | bool VerifyOutputFrameBitexactness(size_t frame_length, |
| 65 | size_t num_bands, |
| 66 | size_t frame_index, |
| 67 | const float* const* frame, |
| 68 | int offset) { |
| 69 | float reference_frame_data[kMaxNumBands][2 * kSubFrameLength]; |
| 70 | float* reference_frame[kMaxNumBands]; |
| 71 | for (size_t k = 0; k < num_bands; ++k) { |
| 72 | reference_frame[k] = &reference_frame_data[k][0]; |
| 73 | } |
| 74 | |
| 75 | PopulateInputFrame(frame_length, num_bands, frame_index, reference_frame, |
| 76 | offset); |
| 77 | for (size_t k = 0; k < num_bands; ++k) { |
| 78 | for (size_t i = 0; i < frame_length; ++i) { |
| 79 | if (reference_frame[k][i] != frame[k][i]) { |
| 80 | return false; |
| 81 | } |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | return true; |
| 86 | } |
| 87 | |
| 88 | // Class for testing that the capture data is properly received by the block |
| 89 | // processor and that the processor data is properly passed to the |
| 90 | // EchoCanceller3 output. |
| 91 | class CaptureTransportVerificationProcessor : public BlockProcessor { |
| 92 | public: |
| 93 | explicit CaptureTransportVerificationProcessor(size_t num_bands) {} |
| 94 | ~CaptureTransportVerificationProcessor() override = default; |
| 95 | |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 96 | void ProcessCapture(bool level_change, |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 97 | bool saturated_microphone_signal, |
| 98 | std::vector<std::vector<float>>* capture_block) override { |
| 99 | } |
| 100 | |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 101 | void BufferRender(const std::vector<std::vector<float>>& block) override {} |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 102 | |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 103 | void UpdateEchoLeakageStatus(bool leakage_detected) override {} |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 104 | |
| 105 | private: |
| 106 | RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CaptureTransportVerificationProcessor); |
| 107 | }; |
| 108 | |
| 109 | // Class for testing that the render data is properly received by the block |
| 110 | // processor. |
| 111 | class RenderTransportVerificationProcessor : public BlockProcessor { |
| 112 | public: |
| 113 | explicit RenderTransportVerificationProcessor(size_t num_bands) {} |
| 114 | ~RenderTransportVerificationProcessor() override = default; |
| 115 | |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 116 | void ProcessCapture(bool level_change, |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 117 | bool saturated_microphone_signal, |
| 118 | std::vector<std::vector<float>>* capture_block) override { |
| 119 | std::vector<std::vector<float>> render_block = |
| 120 | received_render_blocks_.front(); |
| 121 | received_render_blocks_.pop_front(); |
| 122 | capture_block->swap(render_block); |
| 123 | } |
| 124 | |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 125 | void BufferRender(const std::vector<std::vector<float>>& block) override { |
| 126 | received_render_blocks_.push_back(block); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 127 | } |
| 128 | |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 129 | void UpdateEchoLeakageStatus(bool leakage_detected) override {} |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 130 | |
| 131 | private: |
| 132 | std::deque<std::vector<std::vector<float>>> received_render_blocks_; |
| 133 | RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RenderTransportVerificationProcessor); |
| 134 | }; |
| 135 | |
| 136 | class EchoCanceller3Tester { |
| 137 | public: |
| 138 | explicit EchoCanceller3Tester(int sample_rate_hz) |
| 139 | : sample_rate_hz_(sample_rate_hz), |
| 140 | num_bands_(NumBandsForRate(sample_rate_hz_)), |
| 141 | frame_length_(sample_rate_hz_ == 8000 ? 80 : 160), |
| 142 | fullband_frame_length_(rtc::CheckedDivExact(sample_rate_hz_, 100)), |
| 143 | capture_buffer_(fullband_frame_length_, |
| 144 | 1, |
| 145 | fullband_frame_length_, |
| 146 | 1, |
| 147 | fullband_frame_length_), |
| 148 | render_buffer_(fullband_frame_length_, |
| 149 | 1, |
| 150 | fullband_frame_length_, |
| 151 | 1, |
| 152 | fullband_frame_length_) {} |
| 153 | |
| 154 | // Verifies that the capture data is properly received by the block processor |
| 155 | // and that the processor data is properly passed to the EchoCanceller3 |
| 156 | // output. |
| 157 | void RunCaptureTransportVerificationTest() { |
| 158 | EchoCanceller3 aec3( |
| 159 | sample_rate_hz_, false, |
| 160 | std::unique_ptr<BlockProcessor>( |
| 161 | new CaptureTransportVerificationProcessor(num_bands_))); |
| 162 | |
| 163 | for (size_t frame_index = 0; frame_index < kNumFramesToProcess; |
| 164 | ++frame_index) { |
| 165 | aec3.AnalyzeCapture(&capture_buffer_); |
| 166 | OptionalBandSplit(); |
| 167 | PopulateInputFrame(frame_length_, num_bands_, frame_index, |
| 168 | &capture_buffer_.split_bands_f(0)[0], 0); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 169 | PopulateInputFrame(frame_length_, frame_index, |
| 170 | &render_buffer_.channels_f()[0][0], 0); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 171 | |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 172 | aec3.AnalyzeRender(&render_buffer_); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 173 | aec3.ProcessCapture(&capture_buffer_, false); |
| 174 | EXPECT_TRUE(VerifyOutputFrameBitexactness( |
| 175 | frame_length_, num_bands_, frame_index, |
| 176 | &capture_buffer_.split_bands_f(0)[0], -64)); |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | // Test method for testing that the render data is properly received by the |
| 181 | // block processor. |
| 182 | void RunRenderTransportVerificationTest() { |
| 183 | EchoCanceller3 aec3( |
| 184 | sample_rate_hz_, false, |
| 185 | std::unique_ptr<BlockProcessor>( |
| 186 | new RenderTransportVerificationProcessor(num_bands_))); |
| 187 | |
| 188 | for (size_t frame_index = 0; frame_index < kNumFramesToProcess; |
| 189 | ++frame_index) { |
| 190 | aec3.AnalyzeCapture(&capture_buffer_); |
| 191 | OptionalBandSplit(); |
| 192 | PopulateInputFrame(frame_length_, num_bands_, frame_index, |
| 193 | &capture_buffer_.split_bands_f(0)[0], 100); |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 194 | PopulateInputFrame(frame_length_, num_bands_, frame_index, |
| 195 | &render_buffer_.split_bands_f(0)[0], 0); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 196 | |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 197 | aec3.AnalyzeRender(&render_buffer_); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 198 | aec3.ProcessCapture(&capture_buffer_, false); |
| 199 | EXPECT_TRUE(VerifyOutputFrameBitexactness( |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 200 | frame_length_, num_bands_, frame_index, |
| 201 | &capture_buffer_.split_bands_f(0)[0], -64)); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 202 | } |
| 203 | } |
| 204 | |
| 205 | // Verifies that information about echo path changes are properly propagated |
| 206 | // to the block processor. |
| 207 | // The cases tested are: |
| 208 | // -That no set echo path change flags are received when there is no echo path |
| 209 | // change. |
| 210 | // -That set echo path change flags are received and continues to be received |
| 211 | // as long as echo path changes are flagged. |
| 212 | // -That set echo path change flags are no longer received when echo path |
| 213 | // change events stop being flagged. |
| 214 | enum class EchoPathChangeTestVariant { kNone, kOneSticky, kOneNonSticky }; |
| 215 | |
| 216 | void RunEchoPathChangeVerificationTest( |
| 217 | EchoPathChangeTestVariant echo_path_change_test_variant) { |
| 218 | const size_t num_full_blocks_per_frame = |
| 219 | rtc::CheckedDivExact(LowestBandRate(sample_rate_hz_), 100) / kBlockSize; |
| 220 | const size_t expected_num_block_to_process = |
| 221 | (kNumFramesToProcess * |
| 222 | rtc::CheckedDivExact(LowestBandRate(sample_rate_hz_), 100)) / |
| 223 | kBlockSize; |
| 224 | std::unique_ptr<testing::StrictMock<webrtc::test::MockBlockProcessor>> |
| 225 | block_processor_mock( |
| 226 | new StrictMock<webrtc::test::MockBlockProcessor>()); |
| 227 | EXPECT_CALL(*block_processor_mock, BufferRender(_)) |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 228 | .Times(expected_num_block_to_process); |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 229 | EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(_)).Times(0); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 230 | |
| 231 | switch (echo_path_change_test_variant) { |
| 232 | case EchoPathChangeTestVariant::kNone: |
| 233 | EXPECT_CALL(*block_processor_mock, ProcessCapture(false, _, _)) |
| 234 | .Times(expected_num_block_to_process); |
| 235 | break; |
| 236 | case EchoPathChangeTestVariant::kOneSticky: |
| 237 | EXPECT_CALL(*block_processor_mock, ProcessCapture(true, _, _)) |
| 238 | .Times(expected_num_block_to_process); |
| 239 | break; |
| 240 | case EchoPathChangeTestVariant::kOneNonSticky: |
| 241 | EXPECT_CALL(*block_processor_mock, ProcessCapture(true, _, _)) |
| 242 | .Times(num_full_blocks_per_frame); |
| 243 | EXPECT_CALL(*block_processor_mock, ProcessCapture(false, _, _)) |
| 244 | .Times(expected_num_block_to_process - num_full_blocks_per_frame); |
| 245 | break; |
| 246 | } |
| 247 | |
| 248 | EchoCanceller3 aec3(sample_rate_hz_, false, |
| 249 | std::move(block_processor_mock)); |
| 250 | |
| 251 | for (size_t frame_index = 0; frame_index < kNumFramesToProcess; |
| 252 | ++frame_index) { |
| 253 | bool echo_path_change = false; |
| 254 | switch (echo_path_change_test_variant) { |
| 255 | case EchoPathChangeTestVariant::kNone: |
| 256 | break; |
| 257 | case EchoPathChangeTestVariant::kOneSticky: |
| 258 | echo_path_change = true; |
| 259 | break; |
| 260 | case EchoPathChangeTestVariant::kOneNonSticky: |
| 261 | if (frame_index == 0) { |
| 262 | echo_path_change = true; |
| 263 | } |
| 264 | break; |
| 265 | } |
| 266 | |
| 267 | aec3.AnalyzeCapture(&capture_buffer_); |
| 268 | OptionalBandSplit(); |
| 269 | |
| 270 | PopulateInputFrame(frame_length_, num_bands_, frame_index, |
| 271 | &capture_buffer_.split_bands_f(0)[0], 0); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 272 | PopulateInputFrame(frame_length_, frame_index, |
| 273 | &render_buffer_.channels_f()[0][0], 0); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 274 | |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 275 | aec3.AnalyzeRender(&render_buffer_); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 276 | aec3.ProcessCapture(&capture_buffer_, echo_path_change); |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | // Test for verifying that echo leakage information is being properly passed |
| 281 | // to the processor. |
| 282 | // The cases tested are: |
| 283 | // -That no method calls are received when they should not. |
| 284 | // -That false values are received each time they are flagged. |
| 285 | // -That true values are received each time they are flagged. |
| 286 | // -That a false value is received when flagged after a true value has been |
| 287 | // flagged. |
| 288 | enum class EchoLeakageTestVariant { |
| 289 | kNone, |
| 290 | kFalseSticky, |
| 291 | kTrueSticky, |
| 292 | kTrueNonSticky |
| 293 | }; |
| 294 | |
| 295 | void RunEchoLeakageVerificationTest( |
| 296 | EchoLeakageTestVariant leakage_report_variant) { |
| 297 | const size_t expected_num_block_to_process = |
| 298 | (kNumFramesToProcess * |
| 299 | rtc::CheckedDivExact(LowestBandRate(sample_rate_hz_), 100)) / |
| 300 | kBlockSize; |
| 301 | std::unique_ptr<testing::StrictMock<webrtc::test::MockBlockProcessor>> |
| 302 | block_processor_mock( |
| 303 | new StrictMock<webrtc::test::MockBlockProcessor>()); |
| 304 | EXPECT_CALL(*block_processor_mock, BufferRender(_)) |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 305 | .Times(expected_num_block_to_process); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 306 | EXPECT_CALL(*block_processor_mock, ProcessCapture(_, _, _)) |
| 307 | .Times(expected_num_block_to_process); |
| 308 | |
| 309 | switch (leakage_report_variant) { |
| 310 | case EchoLeakageTestVariant::kNone: |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 311 | EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(_)).Times(0); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 312 | break; |
| 313 | case EchoLeakageTestVariant::kFalseSticky: |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 314 | EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(false)) |
| 315 | .Times(1); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 316 | break; |
| 317 | case EchoLeakageTestVariant::kTrueSticky: |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 318 | EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(true)) |
| 319 | .Times(1); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 320 | break; |
| 321 | case EchoLeakageTestVariant::kTrueNonSticky: { |
| 322 | testing::InSequence s; |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 323 | EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(true)) |
| 324 | .Times(1); |
| 325 | EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(false)) |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 326 | .Times(kNumFramesToProcess - 1); |
| 327 | } break; |
| 328 | } |
| 329 | |
| 330 | EchoCanceller3 aec3(sample_rate_hz_, false, |
| 331 | std::move(block_processor_mock)); |
| 332 | |
| 333 | for (size_t frame_index = 0; frame_index < kNumFramesToProcess; |
| 334 | ++frame_index) { |
| 335 | switch (leakage_report_variant) { |
| 336 | case EchoLeakageTestVariant::kNone: |
| 337 | break; |
| 338 | case EchoLeakageTestVariant::kFalseSticky: |
| 339 | if (frame_index == 0) { |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 340 | aec3.UpdateEchoLeakageStatus(false); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 341 | } |
| 342 | break; |
| 343 | case EchoLeakageTestVariant::kTrueSticky: |
| 344 | if (frame_index == 0) { |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 345 | aec3.UpdateEchoLeakageStatus(true); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 346 | } |
| 347 | break; |
| 348 | case EchoLeakageTestVariant::kTrueNonSticky: |
| 349 | if (frame_index == 0) { |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 350 | aec3.UpdateEchoLeakageStatus(true); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 351 | } else { |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 352 | aec3.UpdateEchoLeakageStatus(false); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 353 | } |
| 354 | break; |
| 355 | } |
| 356 | |
| 357 | aec3.AnalyzeCapture(&capture_buffer_); |
| 358 | OptionalBandSplit(); |
| 359 | |
| 360 | PopulateInputFrame(frame_length_, num_bands_, frame_index, |
| 361 | &capture_buffer_.split_bands_f(0)[0], 0); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 362 | PopulateInputFrame(frame_length_, frame_index, |
| 363 | &render_buffer_.channels_f()[0][0], 0); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 364 | |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 365 | aec3.AnalyzeRender(&render_buffer_); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 366 | aec3.ProcessCapture(&capture_buffer_, false); |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | // This verifies that saturation information is properly passed to the |
| 371 | // BlockProcessor. |
| 372 | // The cases tested are: |
| 373 | // -That no saturation event is passed to the processor if there is no |
| 374 | // saturation. |
| 375 | // -That one frame with one negative saturated sample value is reported to be |
| 376 | // saturated and that following non-saturated frames are properly reported as |
| 377 | // not being saturated. |
| 378 | // -That one frame with one positive saturated sample value is reported to be |
| 379 | // saturated and that following non-saturated frames are properly reported as |
| 380 | // not being saturated. |
| 381 | enum class SaturationTestVariant { kNone, kOneNegative, kOnePositive }; |
| 382 | |
| 383 | void RunCaptureSaturationVerificationTest( |
| 384 | SaturationTestVariant saturation_variant) { |
| 385 | const size_t num_full_blocks_per_frame = |
| 386 | rtc::CheckedDivExact(LowestBandRate(sample_rate_hz_), 100) / kBlockSize; |
| 387 | const size_t expected_num_block_to_process = |
| 388 | (kNumFramesToProcess * |
| 389 | rtc::CheckedDivExact(LowestBandRate(sample_rate_hz_), 100)) / |
| 390 | kBlockSize; |
| 391 | std::unique_ptr<testing::StrictMock<webrtc::test::MockBlockProcessor>> |
| 392 | block_processor_mock( |
| 393 | new StrictMock<webrtc::test::MockBlockProcessor>()); |
| 394 | EXPECT_CALL(*block_processor_mock, BufferRender(_)) |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 395 | .Times(expected_num_block_to_process); |
peah | 69221db | 2017-01-27 03:28:19 -0800 | [diff] [blame] | 396 | EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(_)).Times(0); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 397 | |
| 398 | switch (saturation_variant) { |
| 399 | case SaturationTestVariant::kNone: |
| 400 | EXPECT_CALL(*block_processor_mock, ProcessCapture(_, false, _)) |
| 401 | .Times(expected_num_block_to_process); |
| 402 | break; |
| 403 | case SaturationTestVariant::kOneNegative: { |
| 404 | testing::InSequence s; |
| 405 | EXPECT_CALL(*block_processor_mock, ProcessCapture(_, true, _)) |
| 406 | .Times(num_full_blocks_per_frame); |
| 407 | EXPECT_CALL(*block_processor_mock, ProcessCapture(_, false, _)) |
| 408 | .Times(expected_num_block_to_process - num_full_blocks_per_frame); |
| 409 | } break; |
| 410 | case SaturationTestVariant::kOnePositive: { |
| 411 | testing::InSequence s; |
| 412 | EXPECT_CALL(*block_processor_mock, ProcessCapture(_, true, _)) |
| 413 | .Times(num_full_blocks_per_frame); |
| 414 | EXPECT_CALL(*block_processor_mock, ProcessCapture(_, false, _)) |
| 415 | .Times(expected_num_block_to_process - num_full_blocks_per_frame); |
| 416 | } break; |
| 417 | } |
| 418 | |
| 419 | EchoCanceller3 aec3(sample_rate_hz_, false, |
| 420 | std::move(block_processor_mock)); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 421 | for (size_t frame_index = 0; frame_index < kNumFramesToProcess; |
| 422 | ++frame_index) { |
| 423 | for (int k = 0; k < fullband_frame_length_; ++k) { |
| 424 | capture_buffer_.channels_f()[0][k] = 0.f; |
| 425 | } |
| 426 | switch (saturation_variant) { |
| 427 | case SaturationTestVariant::kNone: |
| 428 | break; |
| 429 | case SaturationTestVariant::kOneNegative: |
| 430 | if (frame_index == 0) { |
| 431 | capture_buffer_.channels_f()[0][10] = -32768.f; |
| 432 | } |
| 433 | break; |
| 434 | case SaturationTestVariant::kOnePositive: |
| 435 | if (frame_index == 0) { |
| 436 | capture_buffer_.channels_f()[0][10] = 32767.f; |
| 437 | } |
| 438 | break; |
| 439 | } |
| 440 | |
| 441 | aec3.AnalyzeCapture(&capture_buffer_); |
| 442 | OptionalBandSplit(); |
| 443 | |
| 444 | PopulateInputFrame(frame_length_, num_bands_, frame_index, |
| 445 | &capture_buffer_.split_bands_f(0)[0], 0); |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 446 | PopulateInputFrame(frame_length_, num_bands_, frame_index, |
| 447 | &render_buffer_.split_bands_f(0)[0], 0); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 448 | |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 449 | aec3.AnalyzeRender(&render_buffer_); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 450 | aec3.ProcessCapture(&capture_buffer_, false); |
| 451 | } |
| 452 | } |
| 453 | |
| 454 | // This test verifies that the swapqueue is able to handle jitter in the |
| 455 | // capture and render API calls. |
| 456 | void RunRenderSwapQueueVerificationTest() { |
| 457 | EchoCanceller3 aec3( |
| 458 | sample_rate_hz_, false, |
| 459 | std::unique_ptr<BlockProcessor>( |
| 460 | new RenderTransportVerificationProcessor(num_bands_))); |
| 461 | |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 462 | for (size_t frame_index = 0; frame_index < kRenderTransferQueueSize; |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 463 | ++frame_index) { |
| 464 | if (sample_rate_hz_ > 16000) { |
| 465 | render_buffer_.SplitIntoFrequencyBands(); |
| 466 | } |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 467 | PopulateInputFrame(frame_length_, num_bands_, frame_index, |
| 468 | &render_buffer_.split_bands_f(0)[0], 0); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 469 | |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 470 | if (sample_rate_hz_ > 16000) { |
| 471 | render_buffer_.SplitIntoFrequencyBands(); |
| 472 | } |
| 473 | |
| 474 | aec3.AnalyzeRender(&render_buffer_); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 475 | } |
| 476 | |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 477 | for (size_t frame_index = 0; frame_index < kRenderTransferQueueSize; |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 478 | ++frame_index) { |
| 479 | aec3.AnalyzeCapture(&capture_buffer_); |
| 480 | if (sample_rate_hz_ > 16000) { |
| 481 | capture_buffer_.SplitIntoFrequencyBands(); |
| 482 | } |
| 483 | |
| 484 | PopulateInputFrame(frame_length_, num_bands_, frame_index, |
| 485 | &capture_buffer_.split_bands_f(0)[0], 0); |
| 486 | |
| 487 | aec3.ProcessCapture(&capture_buffer_, false); |
| 488 | EXPECT_TRUE(VerifyOutputFrameBitexactness( |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 489 | frame_length_, num_bands_, frame_index, |
| 490 | &capture_buffer_.split_bands_f(0)[0], -64)); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 491 | } |
| 492 | } |
| 493 | |
| 494 | // This test verifies that a buffer overrun in the render swapqueue is |
| 495 | // properly reported. |
| 496 | void RunRenderPipelineSwapQueueOverrunReturnValueTest() { |
Gustaf Ullberg | bd83b91 | 2017-10-18 12:32:42 +0200 | [diff] [blame^] | 497 | EchoCanceller3 aec3(EchoCanceller3Config(), sample_rate_hz_, false); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 498 | |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 499 | constexpr size_t kRenderTransferQueueSize = 30; |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 500 | for (size_t k = 0; k < 2; ++k) { |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 501 | for (size_t frame_index = 0; frame_index < kRenderTransferQueueSize; |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 502 | ++frame_index) { |
| 503 | if (sample_rate_hz_ > 16000) { |
| 504 | render_buffer_.SplitIntoFrequencyBands(); |
| 505 | } |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 506 | PopulateInputFrame(frame_length_, frame_index, |
| 507 | &render_buffer_.channels_f()[0][0], 0); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 508 | |
| 509 | if (k == 0) { |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 510 | aec3.AnalyzeRender(&render_buffer_); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 511 | } else { |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 512 | aec3.AnalyzeRender(&render_buffer_); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 513 | } |
| 514 | } |
| 515 | } |
| 516 | } |
| 517 | |
| 518 | #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) |
| 519 | // Verifies the that the check for the number of bands in the AnalyzeRender |
| 520 | // input is correct by adjusting the sample rates of EchoCanceller3 and the |
| 521 | // input AudioBuffer to have a different number of bands. |
| 522 | void RunAnalyzeRenderNumBandsCheckVerification() { |
| 523 | // Set aec3_sample_rate_hz to be different from sample_rate_hz_ in such a |
| 524 | // way that the number of bands for the rates are different. |
| 525 | const int aec3_sample_rate_hz = sample_rate_hz_ == 48000 ? 32000 : 48000; |
Gustaf Ullberg | bd83b91 | 2017-10-18 12:32:42 +0200 | [diff] [blame^] | 526 | EchoCanceller3 aec3(EchoCanceller3Config(), aec3_sample_rate_hz, false); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 527 | PopulateInputFrame(frame_length_, 0, &render_buffer_.channels_f()[0][0], 0); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 528 | |
| 529 | EXPECT_DEATH(aec3.AnalyzeRender(&render_buffer_), ""); |
| 530 | } |
| 531 | |
| 532 | // Verifies the that the check for the number of bands in the ProcessCapture |
| 533 | // input is correct by adjusting the sample rates of EchoCanceller3 and the |
| 534 | // input AudioBuffer to have a different number of bands. |
| 535 | void RunProcessCaptureNumBandsCheckVerification() { |
| 536 | // Set aec3_sample_rate_hz to be different from sample_rate_hz_ in such a |
| 537 | // way that the number of bands for the rates are different. |
| 538 | const int aec3_sample_rate_hz = sample_rate_hz_ == 48000 ? 32000 : 48000; |
Gustaf Ullberg | bd83b91 | 2017-10-18 12:32:42 +0200 | [diff] [blame^] | 539 | EchoCanceller3 aec3(EchoCanceller3Config(), aec3_sample_rate_hz, false); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 540 | PopulateInputFrame(frame_length_, num_bands_, 0, |
| 541 | &capture_buffer_.split_bands_f(0)[0], 100); |
| 542 | EXPECT_DEATH(aec3.ProcessCapture(&capture_buffer_, false), ""); |
| 543 | } |
| 544 | |
| 545 | // Verifies the that the check for the frame length in the AnalyzeRender input |
| 546 | // is correct by adjusting the sample rates of EchoCanceller3 and the input |
| 547 | // AudioBuffer to have a different frame lengths. |
| 548 | void RunAnalyzeRenderFrameLengthCheckVerification() { |
| 549 | // Set aec3_sample_rate_hz to be different from sample_rate_hz_ in such a |
| 550 | // way that the band frame lengths are different. |
| 551 | const int aec3_sample_rate_hz = sample_rate_hz_ == 8000 ? 16000 : 8000; |
Gustaf Ullberg | bd83b91 | 2017-10-18 12:32:42 +0200 | [diff] [blame^] | 552 | EchoCanceller3 aec3(EchoCanceller3Config(), aec3_sample_rate_hz, false); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 553 | |
| 554 | OptionalBandSplit(); |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 555 | PopulateInputFrame(frame_length_, 0, &render_buffer_.channels_f()[0][0], 0); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 556 | |
| 557 | EXPECT_DEATH(aec3.AnalyzeRender(&render_buffer_), ""); |
| 558 | } |
| 559 | |
| 560 | // Verifies the that the check for the frame length in the AnalyzeRender input |
| 561 | // is correct by adjusting the sample rates of EchoCanceller3 and the input |
| 562 | // AudioBuffer to have a different frame lengths. |
| 563 | void RunProcessCaptureFrameLengthCheckVerification() { |
| 564 | // Set aec3_sample_rate_hz to be different from sample_rate_hz_ in such a |
| 565 | // way that the band frame lengths are different. |
| 566 | const int aec3_sample_rate_hz = sample_rate_hz_ == 8000 ? 16000 : 8000; |
Gustaf Ullberg | bd83b91 | 2017-10-18 12:32:42 +0200 | [diff] [blame^] | 567 | EchoCanceller3 aec3(EchoCanceller3Config(), aec3_sample_rate_hz, false); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 568 | |
| 569 | OptionalBandSplit(); |
| 570 | PopulateInputFrame(frame_length_, num_bands_, 0, |
| 571 | &capture_buffer_.split_bands_f(0)[0], 100); |
| 572 | |
| 573 | EXPECT_DEATH(aec3.ProcessCapture(&capture_buffer_, false), ""); |
| 574 | } |
| 575 | |
| 576 | #endif |
| 577 | |
| 578 | private: |
| 579 | void OptionalBandSplit() { |
| 580 | if (sample_rate_hz_ > 16000) { |
| 581 | capture_buffer_.SplitIntoFrequencyBands(); |
| 582 | render_buffer_.SplitIntoFrequencyBands(); |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | static constexpr size_t kNumFramesToProcess = 20; |
| 587 | const int sample_rate_hz_; |
| 588 | const size_t num_bands_; |
| 589 | const size_t frame_length_; |
| 590 | const int fullband_frame_length_; |
| 591 | AudioBuffer capture_buffer_; |
| 592 | AudioBuffer render_buffer_; |
| 593 | |
| 594 | RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(EchoCanceller3Tester); |
| 595 | }; |
| 596 | |
| 597 | std::string ProduceDebugText(int sample_rate_hz) { |
| 598 | std::ostringstream ss; |
| 599 | ss << "Sample rate: " << sample_rate_hz; |
| 600 | return ss.str(); |
| 601 | } |
| 602 | |
| 603 | std::string ProduceDebugText(int sample_rate_hz, int variant) { |
| 604 | std::ostringstream ss; |
| 605 | ss << "Sample rate: " << sample_rate_hz << ", variant: " << variant; |
| 606 | return ss.str(); |
| 607 | } |
| 608 | |
| 609 | } // namespace |
| 610 | |
| 611 | TEST(EchoCanceller3Buffering, CaptureBitexactness) { |
| 612 | for (auto rate : {8000, 16000, 32000, 48000}) { |
| 613 | SCOPED_TRACE(ProduceDebugText(rate)); |
| 614 | EchoCanceller3Tester(rate).RunCaptureTransportVerificationTest(); |
| 615 | } |
| 616 | } |
| 617 | |
| 618 | TEST(EchoCanceller3Buffering, RenderBitexactness) { |
| 619 | for (auto rate : {8000, 16000, 32000, 48000}) { |
| 620 | SCOPED_TRACE(ProduceDebugText(rate)); |
| 621 | EchoCanceller3Tester(rate).RunRenderTransportVerificationTest(); |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | TEST(EchoCanceller3Buffering, RenderSwapQueue) { |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 626 | for (auto rate : {8000, 16000}) { |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 627 | SCOPED_TRACE(ProduceDebugText(rate)); |
| 628 | EchoCanceller3Tester(rate).RunRenderSwapQueueVerificationTest(); |
| 629 | } |
| 630 | } |
| 631 | |
| 632 | TEST(EchoCanceller3Buffering, RenderSwapQueueOverrunReturnValue) { |
| 633 | for (auto rate : {8000, 16000, 32000, 48000}) { |
| 634 | SCOPED_TRACE(ProduceDebugText(rate)); |
| 635 | EchoCanceller3Tester(rate) |
| 636 | .RunRenderPipelineSwapQueueOverrunReturnValueTest(); |
| 637 | } |
| 638 | } |
| 639 | |
| 640 | TEST(EchoCanceller3Messaging, CaptureSaturation) { |
| 641 | auto variants = {EchoCanceller3Tester::SaturationTestVariant::kNone, |
| 642 | EchoCanceller3Tester::SaturationTestVariant::kOneNegative, |
| 643 | EchoCanceller3Tester::SaturationTestVariant::kOnePositive}; |
| 644 | for (auto rate : {8000, 16000, 32000, 48000}) { |
| 645 | for (auto variant : variants) { |
| 646 | SCOPED_TRACE(ProduceDebugText(rate, static_cast<int>(variant))); |
| 647 | EchoCanceller3Tester(rate).RunCaptureSaturationVerificationTest(variant); |
| 648 | } |
| 649 | } |
| 650 | } |
| 651 | |
| 652 | TEST(EchoCanceller3Messaging, EchoPathChange) { |
| 653 | auto variants = { |
| 654 | EchoCanceller3Tester::EchoPathChangeTestVariant::kNone, |
| 655 | EchoCanceller3Tester::EchoPathChangeTestVariant::kOneSticky, |
| 656 | EchoCanceller3Tester::EchoPathChangeTestVariant::kOneNonSticky}; |
| 657 | for (auto rate : {8000, 16000, 32000, 48000}) { |
| 658 | for (auto variant : variants) { |
| 659 | SCOPED_TRACE(ProduceDebugText(rate, static_cast<int>(variant))); |
| 660 | EchoCanceller3Tester(rate).RunEchoPathChangeVerificationTest(variant); |
| 661 | } |
| 662 | } |
| 663 | } |
| 664 | |
| 665 | TEST(EchoCanceller3Messaging, EchoLeakage) { |
| 666 | auto variants = { |
| 667 | EchoCanceller3Tester::EchoLeakageTestVariant::kNone, |
| 668 | EchoCanceller3Tester::EchoLeakageTestVariant::kFalseSticky, |
| 669 | EchoCanceller3Tester::EchoLeakageTestVariant::kTrueSticky, |
| 670 | EchoCanceller3Tester::EchoLeakageTestVariant::kTrueNonSticky}; |
| 671 | for (auto rate : {8000, 16000, 32000, 48000}) { |
| 672 | for (auto variant : variants) { |
| 673 | SCOPED_TRACE(ProduceDebugText(rate, static_cast<int>(variant))); |
| 674 | EchoCanceller3Tester(rate).RunEchoLeakageVerificationTest(variant); |
| 675 | } |
| 676 | } |
| 677 | } |
| 678 | |
peah | 697a590 | 2017-06-30 07:06:10 -0700 | [diff] [blame] | 679 | TEST(EchoCanceller3, ConfigValidation) { |
Gustaf Ullberg | bd83b91 | 2017-10-18 12:32:42 +0200 | [diff] [blame^] | 680 | EchoCanceller3Config config; |
peah | 697a590 | 2017-06-30 07:06:10 -0700 | [diff] [blame] | 681 | EXPECT_TRUE(EchoCanceller3::Validate(config)); |
peah | 697a590 | 2017-06-30 07:06:10 -0700 | [diff] [blame] | 682 | } |
| 683 | |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 684 | #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 685 | |
| 686 | TEST(EchoCanceller3InputCheck, WrongCaptureNumBandsCheckVerification) { |
| 687 | for (auto rate : {8000, 16000, 32000, 48000}) { |
| 688 | SCOPED_TRACE(ProduceDebugText(rate)); |
| 689 | EchoCanceller3Tester(rate).RunProcessCaptureNumBandsCheckVerification(); |
| 690 | } |
| 691 | } |
| 692 | |
peah | 522d71b | 2017-02-23 05:16:26 -0800 | [diff] [blame] | 693 | // TODO(peah): Re-enable the test once the issue with memory leaks during DEATH |
| 694 | // tests on test bots has been fixed. |
| 695 | TEST(EchoCanceller3InputCheck, |
| 696 | DISABLED_WrongRenderFrameLengthCheckVerification) { |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 697 | for (auto rate : {8000, 16000}) { |
| 698 | SCOPED_TRACE(ProduceDebugText(rate)); |
| 699 | EchoCanceller3Tester(rate).RunAnalyzeRenderFrameLengthCheckVerification(); |
| 700 | } |
| 701 | } |
| 702 | |
| 703 | TEST(EchoCanceller3InputCheck, WrongCaptureFrameLengthCheckVerification) { |
| 704 | for (auto rate : {8000, 16000}) { |
| 705 | SCOPED_TRACE(ProduceDebugText(rate)); |
| 706 | EchoCanceller3Tester(rate).RunProcessCaptureFrameLengthCheckVerification(); |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | // Verifiers that the verification for null input to the render analysis api |
| 711 | // call works. |
| 712 | TEST(EchoCanceller3InputCheck, NullRenderAnalysisParameter) { |
Gustaf Ullberg | bd83b91 | 2017-10-18 12:32:42 +0200 | [diff] [blame^] | 713 | EXPECT_DEATH(EchoCanceller3(EchoCanceller3Config(), 8000, false) |
| 714 | .AnalyzeRender(nullptr), |
| 715 | ""); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 716 | } |
| 717 | |
| 718 | // Verifiers that the verification for null input to the capture analysis api |
| 719 | // call works. |
| 720 | TEST(EchoCanceller3InputCheck, NullCaptureAnalysisParameter) { |
Gustaf Ullberg | bd83b91 | 2017-10-18 12:32:42 +0200 | [diff] [blame^] | 721 | EXPECT_DEATH(EchoCanceller3(EchoCanceller3Config(), 8000, false) |
| 722 | .AnalyzeCapture(nullptr), |
| 723 | ""); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 724 | } |
| 725 | |
| 726 | // Verifiers that the verification for null input to the capture processing api |
| 727 | // call works. |
| 728 | TEST(EchoCanceller3InputCheck, NullCaptureProcessingParameter) { |
Gustaf Ullberg | bd83b91 | 2017-10-18 12:32:42 +0200 | [diff] [blame^] | 729 | EXPECT_DEATH(EchoCanceller3(EchoCanceller3Config(), 8000, false) |
| 730 | .ProcessCapture(nullptr, false), |
| 731 | ""); |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 732 | } |
| 733 | |
peah | 2192089 | 2017-02-08 05:08:56 -0800 | [diff] [blame] | 734 | // Verifies the check for correct sample rate. |
peah | cf02cf1 | 2017-04-05 14:18:07 -0700 | [diff] [blame] | 735 | // TODO(peah): Re-enable the test once the issue with memory leaks during DEATH |
| 736 | // tests on test bots has been fixed. |
| 737 | TEST(EchoCanceller3InputCheck, DISABLED_WrongSampleRate) { |
peah | 2192089 | 2017-02-08 05:08:56 -0800 | [diff] [blame] | 738 | ApmDataDumper data_dumper(0); |
Gustaf Ullberg | bd83b91 | 2017-10-18 12:32:42 +0200 | [diff] [blame^] | 739 | EXPECT_DEATH(EchoCanceller3(EchoCanceller3Config(), 8001, false), ""); |
peah | 2192089 | 2017-02-08 05:08:56 -0800 | [diff] [blame] | 740 | } |
| 741 | |
peah | d026354 | 2017-01-03 04:20:34 -0800 | [diff] [blame] | 742 | #endif |
| 743 | |
| 744 | } // namespace webrtc |