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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 EXPECT_TRUE(source->options().experimental_agc.Get(&value)); | 71 EXPECT_TRUE(source->options().experimental_agc.Get(&value)); |
72 EXPECT_TRUE(value); | 72 EXPECT_TRUE(value); |
73 EXPECT_TRUE(source->options().noise_suppression.Get(&value)); | 73 EXPECT_TRUE(source->options().noise_suppression.Get(&value)); |
74 EXPECT_FALSE(value); | 74 EXPECT_FALSE(value); |
75 EXPECT_TRUE(source->options().highpass_filter.Get(&value)); | 75 EXPECT_TRUE(source->options().highpass_filter.Get(&value)); |
76 EXPECT_TRUE(value); | 76 EXPECT_TRUE(value); |
77 EXPECT_TRUE(source->options().aec_dump.Get(&value)); | 77 EXPECT_TRUE(source->options().aec_dump.Get(&value)); |
78 EXPECT_TRUE(value); | 78 EXPECT_TRUE(value); |
79 } | 79 } |
80 | 80 |
81 // TODO(henrik.lundin) Remove SetExtendedFilterEchoCancellationOff test. | |
82 // https://code.google.com/p/webrtc/issues/detail?id=4696 | |
83 TEST(LocalAudioSourceTest, SetExtendedFilterEchoCancellationOff) { | |
84 webrtc::FakeConstraints constraints; | |
85 constraints.AddOptional( | |
86 MediaConstraintsInterface::kExtendedFilterEchoCancellation, false); | |
87 | |
88 rtc::scoped_refptr<LocalAudioSource> source = LocalAudioSource::Create( | |
89 PeerConnectionFactoryInterface::Options(), &constraints); | |
90 | |
91 bool value; | |
92 EXPECT_TRUE(source->options().extended_filter_aec.Get(&value)); | |
93 EXPECT_FALSE(value); | |
94 } | |
95 | |
96 // TODO(henrik.lundin) Remove SetExperimentalEchoCancellationOn test. | |
97 // https://code.google.com/p/webrtc/issues/detail?id=4696 | |
98 TEST(LocalAudioSourceTest, SetExperimentalEchoCancellationOn) { | |
99 webrtc::FakeConstraints constraints; | |
100 constraints.AddOptional( | |
101 MediaConstraintsInterface::kExperimentalEchoCancellation, true); | |
102 | |
103 rtc::scoped_refptr<LocalAudioSource> source = LocalAudioSource::Create( | |
104 PeerConnectionFactoryInterface::Options(), &constraints); | |
105 | |
106 bool value; | |
107 EXPECT_TRUE(source->options().extended_filter_aec.Get(&value)); | |
108 EXPECT_TRUE(value); | |
109 } | |
110 | |
111 // TODO(henrik.lundin) Remove SetExperimentalEchoCancellationOff test. | |
112 // https://code.google.com/p/webrtc/issues/detail?id=4696 | |
113 TEST(LocalAudioSourceTest, SetExperimentalEchoCancellationOff) { | |
114 webrtc::FakeConstraints constraints; | |
115 constraints.AddOptional( | |
116 MediaConstraintsInterface::kExperimentalEchoCancellation, false); | |
117 | |
118 rtc::scoped_refptr<LocalAudioSource> source = LocalAudioSource::Create( | |
119 PeerConnectionFactoryInterface::Options(), &constraints); | |
120 | |
121 bool value; | |
122 EXPECT_TRUE(source->options().extended_filter_aec.Get(&value)); | |
123 EXPECT_FALSE(value); | |
124 } | |
125 | |
126 TEST(LocalAudioSourceTest, OptionNotSet) { | 81 TEST(LocalAudioSourceTest, OptionNotSet) { |
127 webrtc::FakeConstraints constraints; | 82 webrtc::FakeConstraints constraints; |
128 rtc::scoped_refptr<LocalAudioSource> source = | 83 rtc::scoped_refptr<LocalAudioSource> source = |
129 LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(), | 84 LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(), |
130 &constraints); | 85 &constraints); |
131 bool value; | 86 bool value; |
132 EXPECT_FALSE(source->options().highpass_filter.Get(&value)); | 87 EXPECT_FALSE(source->options().highpass_filter.Get(&value)); |
133 } | 88 } |
134 | 89 |
135 TEST(LocalAudioSourceTest, MandatoryOverridesOptional) { | 90 TEST(LocalAudioSourceTest, MandatoryOverridesOptional) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 125 |
171 rtc::scoped_refptr<LocalAudioSource> source = | 126 rtc::scoped_refptr<LocalAudioSource> source = |
172 LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(), | 127 LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(), |
173 &constraints); | 128 &constraints); |
174 | 129 |
175 EXPECT_EQ(MediaSourceInterface::kLive, source->state()); | 130 EXPECT_EQ(MediaSourceInterface::kLive, source->state()); |
176 bool value; | 131 bool value; |
177 EXPECT_TRUE(source->options().highpass_filter.Get(&value)); | 132 EXPECT_TRUE(source->options().highpass_filter.Get(&value)); |
178 EXPECT_FALSE(value); | 133 EXPECT_FALSE(value); |
179 } | 134 } |
OLD | NEW |