SetOfferedRtpHeaderExtensions: fix error code.
For the case where an unknown header extension URI is attempted to be modified by SetOfferedRtpHeaderExtensions, WebRTC emitted INVALID_PARAMETER. Fix this by emitting UNSUPPORTED_PARAMETER. Bug: chromium:1051821 Change-Id: I98b68e1e3a3f90f9cfa0d45833f46a307c246ad0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201733 Reviewed-by: Henrik Boström <hbos@webrtc.org> Commit-Queue: Markus Handell <handellm@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32983}
This commit is contained in:
committed by
Commit Bot
parent
1669103833
commit
c17bca7410
@ -485,7 +485,7 @@ RTCError RtpTransceiver::SetOfferedRtpHeaderExtensions(
|
||||
header_extensions_to_offer_.begin(), header_extensions_to_offer_.end(),
|
||||
[&entry](const auto& offered) { return entry.uri == offered.uri; });
|
||||
if (it == header_extensions_to_offer_.end()) {
|
||||
return RTCError(RTCErrorType::INVALID_PARAMETER,
|
||||
return RTCError(RTCErrorType::UNSUPPORTED_PARAMETER,
|
||||
"Attempted to modify an unoffered extension.");
|
||||
}
|
||||
|
||||
|
||||
@ -186,7 +186,7 @@ TEST_F(RtpTransceiverTestForHeaderExtensions, RejectsUnsupportedExtension) {
|
||||
{RtpHeaderExtensionCapability("uri3", 1,
|
||||
RtpTransceiverDirection::kSendRecv)});
|
||||
EXPECT_THAT(transceiver_.SetOfferedRtpHeaderExtensions(modified_extensions),
|
||||
Property(&RTCError::type, RTCErrorType::INVALID_PARAMETER));
|
||||
Property(&RTCError::type, RTCErrorType::UNSUPPORTED_PARAMETER));
|
||||
EXPECT_EQ(transceiver_.HeaderExtensionsToOffer(), extensions_);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user