Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: webrtc/voice_engine/voe_codec_unittest.cc

Issue 2177263002: Regression test for issue where Opus DTX status was being forgotten. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Initial version. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 codec2.channels = 2; 144 codec2.channels = 2;
145 EXPECT_FALSE(codec1 == codec2); 145 EXPECT_FALSE(codec1 == codec2);
146 146
147 // Reset to codec2 to codec1 state. 147 // Reset to codec2 to codec1 state.
148 memcpy(&codec2, &codec1, sizeof(CodecInst)); 148 memcpy(&codec2, &codec1, sizeof(CodecInst));
149 // Test modifying the |rate|. 149 // Test modifying the |rate|.
150 codec2.rate = 0; 150 codec2.rate = 0;
151 EXPECT_FALSE(codec1 == codec2); 151 EXPECT_FALSE(codec1 == codec2);
152 } 152 }
153 153
154 // This is a regression test for
155 // https://bugs.chromium.org/p/webrtc/issues/detail?id=6020
156 // The Opus DTX setting was being forgotten after unrelated VoE calls.
minyue-webrtc 2016/07/25 16:13:01 do you know what the fixture "VoECodecTest" does?
ivoc 2016/07/25 17:11:10 I tried reusing it, but it causes a crash (it's ca
minyue-webrtc 2016/07/26 09:37:01 sure, we can remove it in a following CL. Or you c
ivoc 2016/07/26 12:28:31 I think removing is better in this case, since I d
157 TEST(VoECodecInst, RememberOpusDtxAfterSettingChange) {
158 VoiceEngine* voe(VoiceEngine::Create());
159 VoEBase* base(VoEBase::GetInterface(voe));
160 VoECodec* voe_codec(VoECodec::GetInterface(voe));
161 std::unique_ptr<FakeAudioDeviceModule> adm(new FakeAudioDeviceModule);
162
163 base->Init(adm.get());
164
165 CodecInst codec = {111, "opus", 48000, 960, 1, 32000};
166
167 int channel = base->CreateChannel();
168
169 bool DTX = false;
170
171 EXPECT_EQ(0, voe_codec->SetSendCodec(channel, codec));
172 EXPECT_EQ(0, voe_codec->SetOpusDtx(channel, true));
173 EXPECT_EQ(0, voe_codec->SetFECStatus(channel, true));
174 EXPECT_EQ(0, voe_codec->GetOpusDtx(channel, &DTX));
175 EXPECT_TRUE(DTX);
176
177 base->DeleteChannel(channel);
178 base->Terminate();
179 base->Release();
180 voe_codec->Release();
181 VoiceEngine::Delete(voe);
182 }
183
154 } // namespace 184 } // namespace
155 } // namespace voe 185 } // namespace voe
156 } // namespace webrtc 186 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698