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

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

Issue 2456333002: Revert of New statistics interface for APM (Closed)
Patch Set: 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
935 EXPECT_EQ(apm_->kNoError, 932 EXPECT_EQ(apm_->kNoError,
936 apm_->echo_cancellation()->enable_metrics(true)); 933 apm_->echo_cancellation()->enable_metrics(true));
937 EXPECT_TRUE(apm_->echo_cancellation()->are_metrics_enabled()); 934 EXPECT_TRUE(apm_->echo_cancellation()->are_metrics_enabled());
938 EXPECT_EQ(apm_->kNoError, 935 EXPECT_EQ(apm_->kNoError,
939 apm_->echo_cancellation()->enable_metrics(false)); 936 apm_->echo_cancellation()->enable_metrics(false));
940 EXPECT_FALSE(apm_->echo_cancellation()->are_metrics_enabled()); 937 EXPECT_FALSE(apm_->echo_cancellation()->are_metrics_enabled());
941 938
942 EXPECT_EQ(apm_->kNoError,
943 apm_->echo_cancellation()->enable_delay_logging(true));
944 EXPECT_TRUE(apm_->echo_cancellation()->is_delay_logging_enabled());
945 EXPECT_EQ(apm_->kNoError,
946 apm_->echo_cancellation()->enable_delay_logging(false));
947 EXPECT_FALSE(apm_->echo_cancellation()->is_delay_logging_enabled());
948
949 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(false));
950 EXPECT_FALSE(apm_->echo_cancellation()->is_enabled());
951
952 int median = 0; 939 int median = 0;
953 int std = 0; 940 int std = 0;
954 float poor_fraction = 0; 941 float poor_fraction = 0;
955 EXPECT_EQ(apm_->kNotEnabledError, 942 EXPECT_EQ(apm_->kNotEnabledError,
956 apm_->echo_cancellation()->GetDelayMetrics(&median, &std, 943 apm_->echo_cancellation()->GetDelayMetrics(&median, &std,
957 &poor_fraction)); 944 &poor_fraction));
958 945
946 EXPECT_EQ(apm_->kNoError,
947 apm_->echo_cancellation()->enable_delay_logging(true));
948 EXPECT_TRUE(apm_->echo_cancellation()->is_delay_logging_enabled());
949 EXPECT_EQ(apm_->kNoError,
950 apm_->echo_cancellation()->enable_delay_logging(false));
951 EXPECT_FALSE(apm_->echo_cancellation()->is_delay_logging_enabled());
952
959 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true)); 953 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true));
960 EXPECT_TRUE(apm_->echo_cancellation()->is_enabled()); 954 EXPECT_TRUE(apm_->echo_cancellation()->is_enabled());
961 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(false)); 955 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(false));
962 EXPECT_FALSE(apm_->echo_cancellation()->is_enabled()); 956 EXPECT_FALSE(apm_->echo_cancellation()->is_enabled());
963 957
964 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true)); 958 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true));
965 EXPECT_TRUE(apm_->echo_cancellation()->is_enabled()); 959 EXPECT_TRUE(apm_->echo_cancellation()->is_enabled());
966 EXPECT_TRUE(apm_->echo_cancellation()->aec_core() != NULL); 960 EXPECT_TRUE(apm_->echo_cancellation()->aec_core() != NULL);
967 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(false)); 961 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(false));
968 EXPECT_FALSE(apm_->echo_cancellation()->is_enabled()); 962 EXPECT_FALSE(apm_->echo_cancellation()->is_enabled());
(...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after
2878 // TODO(peah): Remove the testing for 2872 // TODO(peah): Remove the testing for
2879 // apm->capture_nonlocked_.level_controller_enabled once the value in config_ 2873 // apm->capture_nonlocked_.level_controller_enabled once the value in config_
2880 // is instead used to activate the level controller. 2874 // is instead used to activate the level controller.
2881 EXPECT_FALSE(apm->capture_nonlocked_.level_controller_enabled); 2875 EXPECT_FALSE(apm->capture_nonlocked_.level_controller_enabled);
2882 EXPECT_NEAR(kTargetLcPeakLeveldBFS, 2876 EXPECT_NEAR(kTargetLcPeakLeveldBFS,
2883 apm->config_.level_controller.initial_peak_level_dbfs, 2877 apm->config_.level_controller.initial_peak_level_dbfs,
2884 std::numeric_limits<float>::epsilon()); 2878 std::numeric_limits<float>::epsilon());
2885 } 2879 }
2886 2880
2887 } // namespace webrtc 2881 } // 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