OLD | NEW |
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 Loading... |
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 cm_->GetSupportedVideoCodecs(&codecs); | 176 codecs = cm_->GetSupportedVideoCodecs(); |
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 cm_->GetSupportedVideoCodecs(&codecs); | 181 codecs = cm_->GetSupportedVideoCodecs(); |
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 cm_->GetSupportedVideoCodecs(&codecs); | 186 codecs = cm_->GetSupportedVideoCodecs(); |
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 cm_->GetSupportedVideoCodecs(&codecs); | 197 codecs = cm_->GetSupportedVideoCodecs(); |
198 EXPECT_TRUE(ContainsMatchingCodec(codecs, rtx_codec)); | 198 EXPECT_TRUE(ContainsMatchingCodec(codecs, rtx_codec)); |
199 } | 199 } |
200 | 200 |
201 } // namespace cricket | 201 } // namespace cricket |
OLD | NEW |