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

Side by Side Diff: talk/media/webrtc/webrtcvideoengine2_unittest.cc

Issue 1486123002: Return a copy of the supported RTP header extensions instead of a reference. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Comments addressed. Created 5 years 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 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 int associated_payload_type; 235 int associated_payload_type;
236 EXPECT_TRUE(engine_codecs[i].GetParam(kCodecParamAssociatedPayloadType, 236 EXPECT_TRUE(engine_codecs[i].GetParam(kCodecParamAssociatedPayloadType,
237 &associated_payload_type)); 237 &associated_payload_type));
238 EXPECT_EQ(default_codec_.id, associated_payload_type); 238 EXPECT_EQ(default_codec_.id, associated_payload_type);
239 return; 239 return;
240 } 240 }
241 FAIL() << "No RTX codec found among default codecs."; 241 FAIL() << "No RTX codec found among default codecs.";
242 } 242 }
243 243
244 TEST_F(WebRtcVideoEngine2Test, SupportsTimestampOffsetHeaderExtension) { 244 TEST_F(WebRtcVideoEngine2Test, SupportsTimestampOffsetHeaderExtension) {
245 std::vector<RtpHeaderExtension> extensions = engine_.rtp_header_extensions(); 245 RtpCapabilities capabilities = engine_.GetCapabilities();
246 ASSERT_FALSE(extensions.empty()); 246 ASSERT_FALSE(capabilities.header_extensions.empty());
247 for (size_t i = 0; i < extensions.size(); ++i) { 247 for (const RtpHeaderExtension& extension : capabilities.header_extensions) {
248 if (extensions[i].uri == kRtpTimestampOffsetHeaderExtension) { 248 if (extension.uri == kRtpTimestampOffsetHeaderExtension) {
249 EXPECT_EQ(kRtpTimestampOffsetHeaderExtensionDefaultId, extensions[i].id); 249 EXPECT_EQ(kRtpTimestampOffsetHeaderExtensionDefaultId, extension.id);
250 return; 250 return;
251 } 251 }
252 } 252 }
253 FAIL() << "Timestamp offset extension not in header-extension list."; 253 FAIL() << "Timestamp offset extension not in header-extension list.";
254 } 254 }
255 255
256 TEST_F(WebRtcVideoEngine2Test, SupportsAbsoluteSenderTimeHeaderExtension) { 256 TEST_F(WebRtcVideoEngine2Test, SupportsAbsoluteSenderTimeHeaderExtension) {
257 std::vector<RtpHeaderExtension> extensions = engine_.rtp_header_extensions(); 257 RtpCapabilities capabilities = engine_.GetCapabilities();
258 ASSERT_FALSE(extensions.empty()); 258 ASSERT_FALSE(capabilities.header_extensions.empty());
259 for (size_t i = 0; i < extensions.size(); ++i) { 259 for (const RtpHeaderExtension& extension : capabilities.header_extensions) {
260 if (extensions[i].uri == kRtpAbsoluteSenderTimeHeaderExtension) { 260 if (extension.uri == kRtpAbsoluteSenderTimeHeaderExtension) {
261 EXPECT_EQ(kRtpAbsoluteSenderTimeHeaderExtensionDefaultId, 261 EXPECT_EQ(kRtpAbsoluteSenderTimeHeaderExtensionDefaultId,
262 extensions[i].id); 262 extension.id);
263 return; 263 return;
264 } 264 }
265 } 265 }
266 FAIL() << "Absolute Sender Time extension not in header-extension list."; 266 FAIL() << "Absolute Sender Time extension not in header-extension list.";
267 } 267 }
268 268
269 class WebRtcVideoEngine2WithSendSideBweTest : public WebRtcVideoEngine2Test { 269 class WebRtcVideoEngine2WithSendSideBweTest : public WebRtcVideoEngine2Test {
270 public: 270 public:
271 WebRtcVideoEngine2WithSendSideBweTest() 271 WebRtcVideoEngine2WithSendSideBweTest()
272 : WebRtcVideoEngine2Test("WebRTC-SendSideBwe/Enabled/") {} 272 : WebRtcVideoEngine2Test("WebRTC-SendSideBwe/Enabled/") {}
273 }; 273 };
274 274
275 TEST_F(WebRtcVideoEngine2WithSendSideBweTest, 275 TEST_F(WebRtcVideoEngine2WithSendSideBweTest,
276 SupportsTransportSequenceNumberHeaderExtension) { 276 SupportsTransportSequenceNumberHeaderExtension) {
277 std::vector<RtpHeaderExtension> extensions = engine_.rtp_header_extensions(); 277 RtpCapabilities capabilities = engine_.GetCapabilities();
278 ASSERT_FALSE(extensions.empty()); 278 ASSERT_FALSE(capabilities.header_extensions.empty());
279 for (size_t i = 0; i < extensions.size(); ++i) { 279 for (const RtpHeaderExtension& extension : capabilities.header_extensions) {
280 if (extensions[i].uri == kRtpTransportSequenceNumberHeaderExtension) { 280 if (extension.uri == kRtpTransportSequenceNumberHeaderExtension) {
281 EXPECT_EQ(kRtpTransportSequenceNumberHeaderExtensionDefaultId, 281 EXPECT_EQ(kRtpTransportSequenceNumberHeaderExtensionDefaultId,
282 extensions[i].id); 282 extension.id);
283 return; 283 return;
284 } 284 }
285 } 285 }
286 FAIL() << "Transport sequence number extension not in header-extension list."; 286 FAIL() << "Transport sequence number extension not in header-extension list.";
287 } 287 }
288 288
289 TEST_F(WebRtcVideoEngine2Test, SupportsVideoRotationHeaderExtension) { 289 TEST_F(WebRtcVideoEngine2Test, SupportsVideoRotationHeaderExtension) {
290 std::vector<RtpHeaderExtension> extensions = engine_.rtp_header_extensions(); 290 RtpCapabilities capabilities = engine_.GetCapabilities();
291 ASSERT_FALSE(extensions.empty()); 291 ASSERT_FALSE(capabilities.header_extensions.empty());
292 for (size_t i = 0; i < extensions.size(); ++i) { 292 for (const RtpHeaderExtension& extension : capabilities.header_extensions) {
293 if (extensions[i].uri == kRtpVideoRotationHeaderExtension) { 293 if (extension.uri == kRtpVideoRotationHeaderExtension) {
294 EXPECT_EQ(kRtpVideoRotationHeaderExtensionDefaultId, extensions[i].id); 294 EXPECT_EQ(kRtpVideoRotationHeaderExtensionDefaultId, extension.id);
295 return; 295 return;
296 } 296 }
297 } 297 }
298 FAIL() << "Video Rotation extension not in header-extension list."; 298 FAIL() << "Video Rotation extension not in header-extension list.";
299 } 299 }
300 300
301 TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionBeforeCapturer) { 301 TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionBeforeCapturer) {
302 // Allocate the capturer first to prevent early destruction before channel's 302 // Allocate the capturer first to prevent early destruction before channel's
303 // dtor is called. 303 // dtor is called.
304 cricket::FakeVideoCapturer capturer; 304 cricket::FakeVideoCapturer capturer;
(...skipping 2997 matching lines...) Expand 10 before | Expand all | Expand 10 after
3302 // Ensures that the correct settings are applied to the codec when two temporal 3302 // Ensures that the correct settings are applied to the codec when two temporal
3303 // layer screencasting is enabled, and that the correct simulcast settings are 3303 // layer screencasting is enabled, and that the correct simulcast settings are
3304 // reapplied when disabling screencasting. 3304 // reapplied when disabling screencasting.
3305 TEST_F(WebRtcVideoChannel2SimulcastTest, 3305 TEST_F(WebRtcVideoChannel2SimulcastTest,
3306 DISABLED_TwoTemporalLayerScreencastSettings) { 3306 DISABLED_TwoTemporalLayerScreencastSettings) {
3307 // TODO(pbos): Implement. 3307 // TODO(pbos): Implement.
3308 FAIL() << "Not implemented."; 3308 FAIL() << "Not implemented.";
3309 } 3309 }
3310 3310
3311 } // namespace cricket 3311 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698