OLD | NEW |
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 Loading... |
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, |
| 956 apm_->echo_cancellation()->GetDelayMetrics(&median, &std, |
| 957 &poor_fraction)); |
| 958 |
953 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true)); | 959 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true)); |
954 EXPECT_TRUE(apm_->echo_cancellation()->is_enabled()); | 960 EXPECT_TRUE(apm_->echo_cancellation()->is_enabled()); |
955 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(false)); | 961 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(false)); |
956 EXPECT_FALSE(apm_->echo_cancellation()->is_enabled()); | 962 EXPECT_FALSE(apm_->echo_cancellation()->is_enabled()); |
957 | 963 |
958 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true)); | 964 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(true)); |
959 EXPECT_TRUE(apm_->echo_cancellation()->is_enabled()); | 965 EXPECT_TRUE(apm_->echo_cancellation()->is_enabled()); |
960 EXPECT_TRUE(apm_->echo_cancellation()->aec_core() != NULL); | 966 EXPECT_TRUE(apm_->echo_cancellation()->aec_core() != NULL); |
961 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(false)); | 967 EXPECT_EQ(apm_->kNoError, apm_->echo_cancellation()->Enable(false)); |
962 EXPECT_FALSE(apm_->echo_cancellation()->is_enabled()); | 968 EXPECT_FALSE(apm_->echo_cancellation()->is_enabled()); |
(...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2872 // TODO(peah): Remove the testing for | 2878 // TODO(peah): Remove the testing for |
2873 // apm->capture_nonlocked_.level_controller_enabled once the value in config_ | 2879 // apm->capture_nonlocked_.level_controller_enabled once the value in config_ |
2874 // is instead used to activate the level controller. | 2880 // is instead used to activate the level controller. |
2875 EXPECT_FALSE(apm->capture_nonlocked_.level_controller_enabled); | 2881 EXPECT_FALSE(apm->capture_nonlocked_.level_controller_enabled); |
2876 EXPECT_NEAR(kTargetLcPeakLeveldBFS, | 2882 EXPECT_NEAR(kTargetLcPeakLeveldBFS, |
2877 apm->config_.level_controller.initial_peak_level_dbfs, | 2883 apm->config_.level_controller.initial_peak_level_dbfs, |
2878 std::numeric_limits<float>::epsilon()); | 2884 std::numeric_limits<float>::epsilon()); |
2879 } | 2885 } |
2880 | 2886 |
2881 } // namespace webrtc | 2887 } // namespace webrtc |
OLD | NEW |