| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2013 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 17 matching lines...) Expand all Loading... |
| 28 constraints.AddMandatory( | 28 constraints.AddMandatory( |
| 29 MediaConstraintsInterface::kGoogEchoCancellation, false); | 29 MediaConstraintsInterface::kGoogEchoCancellation, false); |
| 30 constraints.AddOptional( | 30 constraints.AddOptional( |
| 31 MediaConstraintsInterface::kExtendedFilterEchoCancellation, true); | 31 MediaConstraintsInterface::kExtendedFilterEchoCancellation, true); |
| 32 constraints.AddOptional(MediaConstraintsInterface::kDAEchoCancellation, true); | 32 constraints.AddOptional(MediaConstraintsInterface::kDAEchoCancellation, true); |
| 33 constraints.AddOptional(MediaConstraintsInterface::kAutoGainControl, true); | 33 constraints.AddOptional(MediaConstraintsInterface::kAutoGainControl, true); |
| 34 constraints.AddOptional( | 34 constraints.AddOptional( |
| 35 MediaConstraintsInterface::kExperimentalAutoGainControl, true); | 35 MediaConstraintsInterface::kExperimentalAutoGainControl, true); |
| 36 constraints.AddMandatory(MediaConstraintsInterface::kNoiseSuppression, false); | 36 constraints.AddMandatory(MediaConstraintsInterface::kNoiseSuppression, false); |
| 37 constraints.AddOptional(MediaConstraintsInterface::kHighpassFilter, true); | 37 constraints.AddOptional(MediaConstraintsInterface::kHighpassFilter, true); |
| 38 constraints.AddOptional(MediaConstraintsInterface::kAecDump, true); | |
| 39 | 38 |
| 40 rtc::scoped_refptr<LocalAudioSource> source = | 39 rtc::scoped_refptr<LocalAudioSource> source = |
| 41 LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(), | 40 LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(), |
| 42 &constraints); | 41 &constraints); |
| 43 | 42 |
| 44 EXPECT_EQ(rtc::Optional<bool>(false), source->options().echo_cancellation); | 43 EXPECT_EQ(rtc::Optional<bool>(false), source->options().echo_cancellation); |
| 45 EXPECT_EQ(rtc::Optional<bool>(true), source->options().extended_filter_aec); | 44 EXPECT_EQ(rtc::Optional<bool>(true), source->options().extended_filter_aec); |
| 46 EXPECT_EQ(rtc::Optional<bool>(true), source->options().delay_agnostic_aec); | 45 EXPECT_EQ(rtc::Optional<bool>(true), source->options().delay_agnostic_aec); |
| 47 EXPECT_EQ(rtc::Optional<bool>(true), source->options().auto_gain_control); | 46 EXPECT_EQ(rtc::Optional<bool>(true), source->options().auto_gain_control); |
| 48 EXPECT_EQ(rtc::Optional<bool>(true), source->options().experimental_agc); | 47 EXPECT_EQ(rtc::Optional<bool>(true), source->options().experimental_agc); |
| 49 EXPECT_EQ(rtc::Optional<bool>(false), source->options().noise_suppression); | 48 EXPECT_EQ(rtc::Optional<bool>(false), source->options().noise_suppression); |
| 50 EXPECT_EQ(rtc::Optional<bool>(true), source->options().highpass_filter); | 49 EXPECT_EQ(rtc::Optional<bool>(true), source->options().highpass_filter); |
| 51 EXPECT_EQ(rtc::Optional<bool>(true), source->options().aec_dump); | |
| 52 } | 50 } |
| 53 | 51 |
| 54 TEST(LocalAudioSourceTest, OptionNotSet) { | 52 TEST(LocalAudioSourceTest, OptionNotSet) { |
| 55 webrtc::FakeConstraints constraints; | 53 webrtc::FakeConstraints constraints; |
| 56 rtc::scoped_refptr<LocalAudioSource> source = | 54 rtc::scoped_refptr<LocalAudioSource> source = |
| 57 LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(), | 55 LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(), |
| 58 &constraints); | 56 &constraints); |
| 59 EXPECT_EQ(rtc::Optional<bool>(), source->options().highpass_filter); | 57 EXPECT_EQ(rtc::Optional<bool>(), source->options().highpass_filter); |
| 60 } | 58 } |
| 61 | 59 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 91 constraints.AddMandatory(MediaConstraintsInterface::kHighpassFilter, false); | 89 constraints.AddMandatory(MediaConstraintsInterface::kHighpassFilter, false); |
| 92 constraints.AddMandatory("invalidKey", false); | 90 constraints.AddMandatory("invalidKey", false); |
| 93 | 91 |
| 94 rtc::scoped_refptr<LocalAudioSource> source = | 92 rtc::scoped_refptr<LocalAudioSource> source = |
| 95 LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(), | 93 LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(), |
| 96 &constraints); | 94 &constraints); |
| 97 | 95 |
| 98 EXPECT_EQ(MediaSourceInterface::kLive, source->state()); | 96 EXPECT_EQ(MediaSourceInterface::kLive, source->state()); |
| 99 EXPECT_EQ(rtc::Optional<bool>(false), source->options().highpass_filter); | 97 EXPECT_EQ(rtc::Optional<bool>(false), source->options().highpass_filter); |
| 100 } | 98 } |
| OLD | NEW |