Change SdpSerializeCandidate to output candidate line without the "a=" and without the leading \r\n", i.e. candidate-attribute as defined in section 15.1 of [ICE].

BUG=crbug/387632
R=juberti@google.com

Review URL: https://webrtc-codereview.appspot.com/17779004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6533 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
wu@webrtc.org 2014-06-24 17:05:10 +00:00
parent 1da152d7f6
commit ec9f5fb34c
2 changed files with 7 additions and 1 deletions

View File

@ -913,6 +913,12 @@ std::string SdpSerializeCandidate(
std::vector<cricket::Candidate> candidates;
candidates.push_back(candidate.candidate());
BuildCandidate(candidates, &message);
// From WebRTC draft section 4.8.1.1 candidate-attribute will be
// just candidate:<candidate> not a=candidate:<blah>CRLF
ASSERT(message.find("a=") == 0);
message.erase(0, 2);
ASSERT(message.find(kLineBreak) == message.size() - 2);
message.resize(message.size() - 2);
return message;
}

View File

@ -1575,7 +1575,7 @@ TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithBufferLatency) {
TEST_F(WebRtcSdpTest, SerializeCandidates) {
std::string message = webrtc::SdpSerializeCandidate(*jcandidate_);
EXPECT_EQ(std::string(kSdpOneCandidate), message);
EXPECT_EQ(std::string(kRawCandidate), message);
}
TEST_F(WebRtcSdpTest, DeserializeSessionDescription) {