Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(621)

Side by Side Diff: webrtc/modules/audio_processing/audio_processing_unittest.cc

Issue 2458993002: Reland of New statistics interface for APM (Closed)
Patch Set: Added implementation of the new non-pure interface function. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
922 EXPECT_EQ(apm_->kNoError, 922 EXPECT_EQ(apm_->kNoError,
923 apm_->echo_cancellation()->set_suppression_level(level[i])); 923 apm_->echo_cancellation()->set_suppression_level(level[i]));
924 EXPECT_EQ(level[i], 924 EXPECT_EQ(level[i],
925 apm_->echo_cancellation()->suppression_level()); 925 apm_->echo_cancellation()->suppression_level());
926 } 926 }
927 927
928 EchoCancellation::Metrics metrics; 928 EchoCancellation::Metrics metrics;
929 EXPECT_EQ(apm_->kNotEnabledError, 929 EXPECT_EQ(apm_->kNotEnabledError,
930 apm_->echo_cancellation()->GetMetrics(&metrics)); 930 apm_->echo_cancellation()->GetMetrics(&metrics));
931 931
932 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true));
933 EXPECT_TRUE(apm_->echo_cancellation()->is_enabled());
934
932 EXPECT_EQ(apm_->kNoError, 935 EXPECT_EQ(apm_->kNoError,
933 apm_->echo_cancellation()->enable_metrics(true)); 936 apm_->echo_cancellation()->enable_metrics(true));
934 EXPECT_TRUE(apm_->echo_cancellation()->are_metrics_enabled()); 937 EXPECT_TRUE(apm_->echo_cancellation()->are_metrics_enabled());
935 EXPECT_EQ(apm_->kNoError, 938 EXPECT_EQ(apm_->kNoError,
936 apm_->echo_cancellation()->enable_metrics(false)); 939 apm_->echo_cancellation()->enable_metrics(false));
937 EXPECT_FALSE(apm_->echo_cancellation()->are_metrics_enabled()); 940 EXPECT_FALSE(apm_->echo_cancellation()->are_metrics_enabled());
938 941
939 int median = 0;
940 int std = 0;
941 float poor_fraction = 0;
942 EXPECT_EQ(apm_->kNotEnabledError,
943 apm_->echo_cancellation()->GetDelayMetrics(&median, &std,
944 &poor_fraction));
945
946 EXPECT_EQ(apm_->kNoError, 942 EXPECT_EQ(apm_->kNoError,
947 apm_->echo_cancellation()->enable_delay_logging(true)); 943 apm_->echo_cancellation()->enable_delay_logging(true));
948 EXPECT_TRUE(apm_->echo_cancellation()->is_delay_logging_enabled()); 944 EXPECT_TRUE(apm_->echo_cancellation()->is_delay_logging_enabled());
949 EXPECT_EQ(apm_->kNoError, 945 EXPECT_EQ(apm_->kNoError,
950 apm_->echo_cancellation()->enable_delay_logging(false)); 946 apm_->echo_cancellation()->enable_delay_logging(false));
951 EXPECT_FALSE(apm_->echo_cancellation()->is_delay_logging_enabled()); 947 EXPECT_FALSE(apm_->echo_cancellation()->is_delay_logging_enabled());
952 948
949 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(false));
950 EXPECT_FALSE(apm_->echo_cancellation()->is_enabled());
951
952 int median = 0;
953 int std = 0;
954 float poor_fraction = 0;
955 EXPECT_EQ(apm_->kNotEnabledError, apm_->echo_cancellation()->GetDelayMetrics(
956 &median, &std, &poor_fraction));
957
953 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true)); 958 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true));
954 EXPECT_TRUE(apm_->echo_cancellation()->is_enabled()); 959 EXPECT_TRUE(apm_->echo_cancellation()->is_enabled());
955 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(false)); 960 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(false));
956 EXPECT_FALSE(apm_->echo_cancellation()->is_enabled()); 961 EXPECT_FALSE(apm_->echo_cancellation()->is_enabled());
957 962
958 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true)); 963 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true));
959 EXPECT_TRUE(apm_->echo_cancellation()->is_enabled()); 964 EXPECT_TRUE(apm_->echo_cancellation()->is_enabled());
960 EXPECT_TRUE(apm_->echo_cancellation()->aec_core() != NULL); 965 EXPECT_TRUE(apm_->echo_cancellation()->aec_core() != NULL);
961 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(false)); 966 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(false));
962 EXPECT_FALSE(apm_->echo_cancellation()->is_enabled()); 967 EXPECT_FALSE(apm_->echo_cancellation()->is_enabled());
(...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after
2872 // TODO(peah): Remove the testing for 2877 // TODO(peah): Remove the testing for
2873 // apm->capture_nonlocked_.level_controller_enabled once the value in config_ 2878 // apm->capture_nonlocked_.level_controller_enabled once the value in config_
2874 // is instead used to activate the level controller. 2879 // is instead used to activate the level controller.
2875 EXPECT_FALSE(apm->capture_nonlocked_.level_controller_enabled); 2880 EXPECT_FALSE(apm->capture_nonlocked_.level_controller_enabled);
2876 EXPECT_NEAR(kTargetLcPeakLeveldBFS, 2881 EXPECT_NEAR(kTargetLcPeakLeveldBFS,
2877 apm->config_.level_controller.initial_peak_level_dbfs, 2882 apm->config_.level_controller.initial_peak_level_dbfs,
2878 std::numeric_limits<float>::epsilon()); 2883 std::numeric_limits<float>::epsilon());
2879 } 2884 }
2880 2885
2881 } // namespace webrtc 2886 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/audio_processing_impl.cc ('k') | webrtc/modules/audio_processing/echo_cancellation_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698