mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +01:00
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:
parent
96dca92046
commit
cb42e10804
2 changed files with 9 additions and 1 deletions
|
@ -220,7 +220,9 @@ std::unique_ptr<SessionDescriptionInterface> JsepSessionDescription::Clone()
|
||||||
auto new_description = std::make_unique<JsepSessionDescription>(type_);
|
auto new_description = std::make_unique<JsepSessionDescription>(type_);
|
||||||
new_description->session_id_ = session_id_;
|
new_description->session_id_ = session_id_;
|
||||||
new_description->session_version_ = session_version_;
|
new_description->session_version_ = session_version_;
|
||||||
new_description->description_ = description_->Clone();
|
if (description_) {
|
||||||
|
new_description->description_ = description_->Clone();
|
||||||
|
}
|
||||||
for (const auto& collection : candidate_collection_) {
|
for (const auto& collection : candidate_collection_) {
|
||||||
new_description->candidate_collection_.push_back(collection.Clone());
|
new_description->candidate_collection_.push_back(collection.Clone());
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,6 +129,12 @@ TEST_F(JsepSessionDescriptionTest, CloneDefault) {
|
||||||
EXPECT_EQ(jsep_desc_->session_version(), new_desc->session_version());
|
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) {
|
TEST_F(JsepSessionDescriptionTest, CloneWithCandidates) {
|
||||||
cricket::Candidate candidate_v4(
|
cricket::Candidate candidate_v4(
|
||||||
cricket::ICE_CANDIDATE_COMPONENT_RTP, "udp",
|
cricket::ICE_CANDIDATE_COMPONENT_RTP, "udp",
|
||||||
|
|
Loading…
Reference in a new issue