Make the JsepSessionDescription clone() method work for the rollback type.

Because clone() method didn't work for rollback type,
rollback using SLD/SRD was broken in iOS SDK after
https://webrtc-review.googlesource.com/c/src/+/209700.

Fixed: webrtc:12912
Change-Id: I84a1fe7b682b2a73657d2fa121e8e529bce219b3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226160
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/master@{#34530}
This commit is contained in:
Byoungchan Lee 2021-07-15 14:09:40 +09:00 committed by WebRTC LUCI CQ
parent 96dca92046
commit cb42e10804
2 changed files with 9 additions and 1 deletions

View file

@ -220,7 +220,9 @@ std::unique_ptr<SessionDescriptionInterface> JsepSessionDescription::Clone()
auto new_description = std::make_unique<JsepSessionDescription>(type_);
new_description->session_id_ = session_id_;
new_description->session_version_ = session_version_;
if (description_) {
new_description->description_ = description_->Clone();
}
for (const auto& collection : candidate_collection_) {
new_description->candidate_collection_.push_back(collection.Clone());
}

View file

@ -129,6 +129,12 @@ TEST_F(JsepSessionDescriptionTest, CloneDefault) {
EXPECT_EQ(jsep_desc_->session_version(), new_desc->session_version());
}
TEST_F(JsepSessionDescriptionTest, CloneRollback) {
auto jsep_desc = std::make_unique<JsepSessionDescription>(SdpType::kRollback);
auto new_desc = jsep_desc->Clone();
EXPECT_EQ(jsep_desc->type(), new_desc->type());
}
TEST_F(JsepSessionDescriptionTest, CloneWithCandidates) {
cricket::Candidate candidate_v4(
cricket::ICE_CANDIDATE_COMPONENT_RTP, "udp",