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

Side by Side Diff: webrtc/pc/channelmanager_unittest.cc

Issue 2489173004: Revert of Stop caching supported codecs in WebRtcVideoEngine2 (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « webrtc/pc/channelmanager.cc ('k') | webrtc/pc/mediasession.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2008 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2008 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 false, cricket::DCT_RTP); 166 false, cricket::DCT_RTP);
167 EXPECT_TRUE(data_channel == nullptr); 167 EXPECT_TRUE(data_channel == nullptr);
168 cm_->Terminate(); 168 cm_->Terminate();
169 } 169 }
170 170
171 TEST_F(ChannelManagerTest, SetVideoRtxEnabled) { 171 TEST_F(ChannelManagerTest, SetVideoRtxEnabled) {
172 std::vector<VideoCodec> codecs; 172 std::vector<VideoCodec> codecs;
173 const VideoCodec rtx_codec(96, "rtx"); 173 const VideoCodec rtx_codec(96, "rtx");
174 174
175 // By default RTX is disabled. 175 // By default RTX is disabled.
176 codecs = cm_->GetSupportedVideoCodecs(); 176 cm_->GetSupportedVideoCodecs(&codecs);
177 EXPECT_FALSE(ContainsMatchingCodec(codecs, rtx_codec)); 177 EXPECT_FALSE(ContainsMatchingCodec(codecs, rtx_codec));
178 178
179 // Enable and check. 179 // Enable and check.
180 EXPECT_TRUE(cm_->SetVideoRtxEnabled(true)); 180 EXPECT_TRUE(cm_->SetVideoRtxEnabled(true));
181 codecs = cm_->GetSupportedVideoCodecs(); 181 cm_->GetSupportedVideoCodecs(&codecs);
182 EXPECT_TRUE(ContainsMatchingCodec(codecs, rtx_codec)); 182 EXPECT_TRUE(ContainsMatchingCodec(codecs, rtx_codec));
183 183
184 // Disable and check. 184 // Disable and check.
185 EXPECT_TRUE(cm_->SetVideoRtxEnabled(false)); 185 EXPECT_TRUE(cm_->SetVideoRtxEnabled(false));
186 codecs = cm_->GetSupportedVideoCodecs(); 186 cm_->GetSupportedVideoCodecs(&codecs);
187 EXPECT_FALSE(ContainsMatchingCodec(codecs, rtx_codec)); 187 EXPECT_FALSE(ContainsMatchingCodec(codecs, rtx_codec));
188 188
189 // Cannot toggle rtx after initialization. 189 // Cannot toggle rtx after initialization.
190 EXPECT_TRUE(cm_->Init()); 190 EXPECT_TRUE(cm_->Init());
191 EXPECT_FALSE(cm_->SetVideoRtxEnabled(true)); 191 EXPECT_FALSE(cm_->SetVideoRtxEnabled(true));
192 EXPECT_FALSE(cm_->SetVideoRtxEnabled(false)); 192 EXPECT_FALSE(cm_->SetVideoRtxEnabled(false));
193 193
194 // Can set again after terminate. 194 // Can set again after terminate.
195 cm_->Terminate(); 195 cm_->Terminate();
196 EXPECT_TRUE(cm_->SetVideoRtxEnabled(true)); 196 EXPECT_TRUE(cm_->SetVideoRtxEnabled(true));
197 codecs = cm_->GetSupportedVideoCodecs(); 197 cm_->GetSupportedVideoCodecs(&codecs);
198 EXPECT_TRUE(ContainsMatchingCodec(codecs, rtx_codec)); 198 EXPECT_TRUE(ContainsMatchingCodec(codecs, rtx_codec));
199 } 199 }
200 200
201 } // namespace cricket 201 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/pc/channelmanager.cc ('k') | webrtc/pc/mediasession.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698