Add check for media transport and bundle policy
Bug: None Change-Id: I36931774438b80ce391e656b8db2f2bb6ed25d8b Reviewed-on: https://webrtc-review.googlesource.com/c/110961 Commit-Queue: Peter Slatala <psla@webrtc.org> Reviewed-by: Steve Anton <steveanton@webrtc.org> Reviewed-by: Anton Sukhanov <sukhanov@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25733}
This commit is contained in:
parent
47dfdca8dd
commit
37227beed5
@ -2997,6 +2997,12 @@ bool PeerConnection::SetConfiguration(const RTCConfiguration& configuration,
|
||||
return SafeSetError(RTCErrorType::INVALID_MODIFICATION, error);
|
||||
}
|
||||
|
||||
if (configuration.use_media_transport_for_data_channels ||
|
||||
configuration.use_media_transport) {
|
||||
RTC_CHECK(configuration.bundle_policy == kBundlePolicyMaxBundle)
|
||||
<< "Media transport requires MaxBundle policy.";
|
||||
}
|
||||
|
||||
// The simplest (and most future-compatible) way to tell if the config was
|
||||
// modified in an invalid way is to copy each property we do support
|
||||
// modifying, then use operator==. There are far more properties we don't
|
||||
|
||||
@ -1426,7 +1426,10 @@ TEST_P(PeerConnectionInterfaceTest, GetConfigurationAfterCreatePeerConnection) {
|
||||
// Check that GetConfiguration returns the last configuration passed into
|
||||
// SetConfiguration.
|
||||
TEST_P(PeerConnectionInterfaceTest, GetConfigurationAfterSetConfiguration) {
|
||||
CreatePeerConnection();
|
||||
PeerConnectionInterface::RTCConfiguration starting_config;
|
||||
starting_config.bundle_policy =
|
||||
webrtc::PeerConnection::kBundlePolicyMaxBundle;
|
||||
CreatePeerConnection(starting_config);
|
||||
|
||||
PeerConnectionInterface::RTCConfiguration config = pc_->GetConfiguration();
|
||||
config.type = PeerConnectionInterface::kRelay;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user