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

Unified 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: Merge 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « talk/media/webrtc/webrtcvideoengine2.cc ('k') | talk/media/webrtc/webrtcvoiceengine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/webrtc/webrtcvideoengine2_unittest.cc
diff --git a/talk/media/webrtc/webrtcvideoengine2_unittest.cc b/talk/media/webrtc/webrtcvideoengine2_unittest.cc
index 832c4d06233a71c40c6c1749eb9f88e626554095..1de27546be93c884afa6faf458f32adb8aa4dbe9 100644
--- a/talk/media/webrtc/webrtcvideoengine2_unittest.cc
+++ b/talk/media/webrtc/webrtcvideoengine2_unittest.cc
@@ -242,11 +242,11 @@ TEST_F(WebRtcVideoEngine2Test, DefaultRtxCodecHasAssociatedPayloadTypeSet) {
}
TEST_F(WebRtcVideoEngine2Test, SupportsTimestampOffsetHeaderExtension) {
- std::vector<RtpHeaderExtension> extensions = engine_.rtp_header_extensions();
- ASSERT_FALSE(extensions.empty());
- for (size_t i = 0; i < extensions.size(); ++i) {
- if (extensions[i].uri == kRtpTimestampOffsetHeaderExtension) {
- EXPECT_EQ(kRtpTimestampOffsetHeaderExtensionDefaultId, extensions[i].id);
+ RtpCapabilities capabilities = engine_.GetCapabilities();
+ ASSERT_FALSE(capabilities.header_extensions.empty());
+ for (const RtpHeaderExtension& extension : capabilities.header_extensions) {
+ if (extension.uri == kRtpTimestampOffsetHeaderExtension) {
+ EXPECT_EQ(kRtpTimestampOffsetHeaderExtensionDefaultId, extension.id);
return;
}
}
@@ -254,12 +254,11 @@ TEST_F(WebRtcVideoEngine2Test, SupportsTimestampOffsetHeaderExtension) {
}
TEST_F(WebRtcVideoEngine2Test, SupportsAbsoluteSenderTimeHeaderExtension) {
- std::vector<RtpHeaderExtension> extensions = engine_.rtp_header_extensions();
- ASSERT_FALSE(extensions.empty());
- for (size_t i = 0; i < extensions.size(); ++i) {
- if (extensions[i].uri == kRtpAbsoluteSenderTimeHeaderExtension) {
- EXPECT_EQ(kRtpAbsoluteSenderTimeHeaderExtensionDefaultId,
- extensions[i].id);
+ RtpCapabilities capabilities = engine_.GetCapabilities();
+ ASSERT_FALSE(capabilities.header_extensions.empty());
+ for (const RtpHeaderExtension& extension : capabilities.header_extensions) {
+ if (extension.uri == kRtpAbsoluteSenderTimeHeaderExtension) {
+ EXPECT_EQ(kRtpAbsoluteSenderTimeHeaderExtensionDefaultId, extension.id);
return;
}
}
@@ -274,12 +273,12 @@ class WebRtcVideoEngine2WithSendSideBweTest : public WebRtcVideoEngine2Test {
TEST_F(WebRtcVideoEngine2WithSendSideBweTest,
SupportsTransportSequenceNumberHeaderExtension) {
- std::vector<RtpHeaderExtension> extensions = engine_.rtp_header_extensions();
- ASSERT_FALSE(extensions.empty());
- for (size_t i = 0; i < extensions.size(); ++i) {
- if (extensions[i].uri == kRtpTransportSequenceNumberHeaderExtension) {
+ RtpCapabilities capabilities = engine_.GetCapabilities();
+ ASSERT_FALSE(capabilities.header_extensions.empty());
+ for (const RtpHeaderExtension& extension : capabilities.header_extensions) {
+ if (extension.uri == kRtpTransportSequenceNumberHeaderExtension) {
EXPECT_EQ(kRtpTransportSequenceNumberHeaderExtensionDefaultId,
- extensions[i].id);
+ extension.id);
return;
}
}
@@ -287,11 +286,11 @@ TEST_F(WebRtcVideoEngine2WithSendSideBweTest,
}
TEST_F(WebRtcVideoEngine2Test, SupportsVideoRotationHeaderExtension) {
- std::vector<RtpHeaderExtension> extensions = engine_.rtp_header_extensions();
- ASSERT_FALSE(extensions.empty());
- for (size_t i = 0; i < extensions.size(); ++i) {
- if (extensions[i].uri == kRtpVideoRotationHeaderExtension) {
- EXPECT_EQ(kRtpVideoRotationHeaderExtensionDefaultId, extensions[i].id);
+ RtpCapabilities capabilities = engine_.GetCapabilities();
+ ASSERT_FALSE(capabilities.header_extensions.empty());
+ for (const RtpHeaderExtension& extension : capabilities.header_extensions) {
+ if (extension.uri == kRtpVideoRotationHeaderExtension) {
+ EXPECT_EQ(kRtpVideoRotationHeaderExtensionDefaultId, extension.id);
return;
}
}
« no previous file with comments | « talk/media/webrtc/webrtcvideoengine2.cc ('k') | talk/media/webrtc/webrtcvoiceengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698