| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 using webrtc::LocalAudioSource; | 39 using webrtc::LocalAudioSource; |
| 40 using webrtc::MediaConstraintsInterface; | 40 using webrtc::MediaConstraintsInterface; |
| 41 using webrtc::MediaSourceInterface; | 41 using webrtc::MediaSourceInterface; |
| 42 using webrtc::PeerConnectionFactoryInterface; | 42 using webrtc::PeerConnectionFactoryInterface; |
| 43 | 43 |
| 44 TEST(LocalAudioSourceTest, SetValidOptions) { | 44 TEST(LocalAudioSourceTest, SetValidOptions) { |
| 45 webrtc::FakeConstraints constraints; | 45 webrtc::FakeConstraints constraints; |
| 46 constraints.AddMandatory(MediaConstraintsInterface::kEchoCancellation, false); | 46 constraints.AddMandatory(MediaConstraintsInterface::kEchoCancellation, false); |
| 47 constraints.AddOptional( | 47 constraints.AddOptional( |
| 48 MediaConstraintsInterface::kExtendedFilterEchoCancellation, true); | 48 MediaConstraintsInterface::kExperimentalEchoCancellation, true); |
| 49 constraints.AddOptional(MediaConstraintsInterface::kDAEchoCancellation, true); | 49 constraints.AddOptional(MediaConstraintsInterface::kDAEchoCancellation, true); |
| 50 constraints.AddOptional(MediaConstraintsInterface::kAutoGainControl, true); | 50 constraints.AddOptional(MediaConstraintsInterface::kAutoGainControl, true); |
| 51 constraints.AddOptional( | 51 constraints.AddOptional( |
| 52 MediaConstraintsInterface::kExperimentalAutoGainControl, true); | 52 MediaConstraintsInterface::kExperimentalAutoGainControl, true); |
| 53 constraints.AddMandatory(MediaConstraintsInterface::kNoiseSuppression, false); | 53 constraints.AddMandatory(MediaConstraintsInterface::kNoiseSuppression, false); |
| 54 constraints.AddOptional(MediaConstraintsInterface::kHighpassFilter, true); | 54 constraints.AddOptional(MediaConstraintsInterface::kHighpassFilter, true); |
| 55 constraints.AddOptional(MediaConstraintsInterface::kAecDump, true); | 55 constraints.AddOptional(MediaConstraintsInterface::kAecDump, true); |
| 56 | 56 |
| 57 rtc::scoped_refptr<LocalAudioSource> source = | 57 rtc::scoped_refptr<LocalAudioSource> source = |
| 58 LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(), | 58 LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(), |
| 59 &constraints); | 59 &constraints); |
| 60 | 60 |
| 61 bool value; | 61 bool value; |
| 62 EXPECT_TRUE(source->options().echo_cancellation.Get(&value)); | 62 EXPECT_TRUE(source->options().echo_cancellation.Get(&value)); |
| 63 EXPECT_FALSE(value); | 63 EXPECT_FALSE(value); |
| 64 EXPECT_TRUE(source->options().extended_filter_aec.Get(&value)); | 64 EXPECT_TRUE(source->options().experimental_aec.Get(&value)); |
| 65 EXPECT_TRUE(value); | 65 EXPECT_TRUE(value); |
| 66 EXPECT_TRUE(source->options().delay_agnostic_aec.Get(&value)); | 66 EXPECT_TRUE(source->options().delay_agnostic_aec.Get(&value)); |
| 67 EXPECT_TRUE(value); | 67 EXPECT_TRUE(value); |
| 68 EXPECT_TRUE(source->options().auto_gain_control.Get(&value)); | 68 EXPECT_TRUE(source->options().auto_gain_control.Get(&value)); |
| 69 EXPECT_TRUE(value); | 69 EXPECT_TRUE(value); |
| 70 EXPECT_TRUE(source->options().experimental_agc.Get(&value)); | 70 EXPECT_TRUE(source->options().experimental_agc.Get(&value)); |
| 71 EXPECT_TRUE(value); | 71 EXPECT_TRUE(value); |
| 72 EXPECT_TRUE(source->options().noise_suppression.Get(&value)); | 72 EXPECT_TRUE(source->options().noise_suppression.Get(&value)); |
| 73 EXPECT_FALSE(value); | 73 EXPECT_FALSE(value); |
| 74 EXPECT_TRUE(source->options().highpass_filter.Get(&value)); | 74 EXPECT_TRUE(source->options().highpass_filter.Get(&value)); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 rtc::scoped_refptr<LocalAudioSource> source = | 123 rtc::scoped_refptr<LocalAudioSource> source = |
| 124 LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(), | 124 LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(), |
| 125 &constraints); | 125 &constraints); |
| 126 | 126 |
| 127 EXPECT_EQ(MediaSourceInterface::kLive, source->state()); | 127 EXPECT_EQ(MediaSourceInterface::kLive, source->state()); |
| 128 bool value; | 128 bool value; |
| 129 EXPECT_TRUE(source->options().highpass_filter.Get(&value)); | 129 EXPECT_TRUE(source->options().highpass_filter.Get(&value)); |
| 130 EXPECT_FALSE(value); | 130 EXPECT_FALSE(value); |
| 131 } | 131 } |
| OLD | NEW |