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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 | 895 |
896 TEST_F(ApmTest, SampleRatesInt) { | 896 TEST_F(ApmTest, SampleRatesInt) { |
897 // Testing invalid sample rates | 897 // Testing invalid sample rates |
898 SetContainerFormat(10000, 2, frame_, &float_cb_); | 898 SetContainerFormat(10000, 2, frame_, &float_cb_); |
899 EXPECT_EQ(apm_->kBadSampleRateError, ProcessStreamChooser(kIntFormat)); | 899 EXPECT_EQ(apm_->kBadSampleRateError, ProcessStreamChooser(kIntFormat)); |
900 // Testing valid sample rates | 900 // Testing valid sample rates |
901 int fs[] = {8000, 16000, 32000, 48000}; | 901 int fs[] = {8000, 16000, 32000, 48000}; |
902 for (size_t i = 0; i < sizeof(fs) / sizeof(*fs); i++) { | 902 for (size_t i = 0; i < sizeof(fs) / sizeof(*fs); i++) { |
903 SetContainerFormat(fs[i], 2, frame_, &float_cb_); | 903 SetContainerFormat(fs[i], 2, frame_, &float_cb_); |
904 EXPECT_NOERR(ProcessStreamChooser(kIntFormat)); | 904 EXPECT_NOERR(ProcessStreamChooser(kIntFormat)); |
905 EXPECT_EQ(fs[i], apm_->input_sample_rate_hz()); | |
906 } | 905 } |
907 } | 906 } |
908 | 907 |
909 TEST_F(ApmTest, EchoCancellation) { | 908 TEST_F(ApmTest, EchoCancellation) { |
910 EXPECT_EQ(apm_->kNoError, | 909 EXPECT_EQ(apm_->kNoError, |
911 apm_->echo_cancellation()->enable_drift_compensation(true)); | 910 apm_->echo_cancellation()->enable_drift_compensation(true)); |
912 EXPECT_TRUE(apm_->echo_cancellation()->is_drift_compensation_enabled()); | 911 EXPECT_TRUE(apm_->echo_cancellation()->is_drift_compensation_enabled()); |
913 EXPECT_EQ(apm_->kNoError, | 912 EXPECT_EQ(apm_->kNoError, |
914 apm_->echo_cancellation()->enable_drift_compensation(false)); | 913 apm_->echo_cancellation()->enable_drift_compensation(false)); |
915 EXPECT_FALSE(apm_->echo_cancellation()->is_drift_compensation_enabled()); | 914 EXPECT_FALSE(apm_->echo_cancellation()->is_drift_compensation_enabled()); |
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2748 std::tr1::make_tuple(16000, 16000, 32000, 16000, 40, 20), | 2747 std::tr1::make_tuple(16000, 16000, 32000, 16000, 40, 20), |
2749 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); | 2748 std::tr1::make_tuple(16000, 16000, 16000, 16000, 0, 0))); |
2750 #endif | 2749 #endif |
2751 | 2750 |
2752 // TODO(henrike): re-implement functionality lost when removing the old main | 2751 // TODO(henrike): re-implement functionality lost when removing the old main |
2753 // function. See | 2752 // function. See |
2754 // https://code.google.com/p/webrtc/issues/detail?id=1981 | 2753 // https://code.google.com/p/webrtc/issues/detail?id=1981 |
2755 | 2754 |
2756 } // namespace | 2755 } // namespace |
2757 } // namespace webrtc | 2756 } // namespace webrtc |
OLD | NEW |