Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Unified Diff: talk/app/webrtc/webrtcsdp_unittest.cc

Issue 1498993002: Add ufrag to the ICE candidate signaling. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: talk/app/webrtc/webrtcsdp_unittest.cc
diff --git a/talk/app/webrtc/webrtcsdp_unittest.cc b/talk/app/webrtc/webrtcsdp_unittest.cc
index cb6a392ab40bb3a99f46b4c3e52974e1452b2aa9..1d1509166b0e7af18713f7660f2ac4a03ce2d122 100644
--- a/talk/app/webrtc/webrtcsdp_unittest.cc
+++ b/talk/app/webrtc/webrtcsdp_unittest.cc
@@ -136,19 +136,19 @@ static const char kSdpFullString[] =
"c=IN IP4 74.125.127.126\r\n"
"a=rtcp:2347 IN IP4 74.125.127.126\r\n"
"a=candidate:a0+B/1 1 udp 2130706432 192.168.1.5 1234 typ host "
- "generation 2\r\n"
+ "generation 2 username ufrag_voice\r\n"
"a=candidate:a0+B/1 2 udp 2130706432 192.168.1.5 1235 typ host "
- "generation 2\r\n"
+ "generation 2 username ufrag_voice\r\n"
"a=candidate:a0+B/2 1 udp 2130706432 ::1 1238 typ host "
- "generation 2\r\n"
+ "generation 2 username ufrag_voice\r\n"
"a=candidate:a0+B/2 2 udp 2130706432 ::1 1239 typ host "
- "generation 2\r\n"
+ "generation 2 username ufrag_voice\r\n"
"a=candidate:a0+B/3 1 udp 2130706432 74.125.127.126 2345 typ srflx "
"raddr 192.168.1.5 rport 2346 "
- "generation 2\r\n"
+ "generation 2 username ufrag_voice\r\n"
"a=candidate:a0+B/3 2 udp 2130706432 74.125.127.126 2347 typ srflx "
"raddr 192.168.1.5 rport 2348 "
- "generation 2\r\n"
+ "generation 2 username ufrag_voice\r\n"
"a=ice-ufrag:ufrag_voice\r\na=ice-pwd:pwd_voice\r\n"
"a=mid:audio_content_name\r\n"
"a=sendrecv\r\n"
@@ -171,17 +171,17 @@ static const char kSdpFullString[] =
"c=IN IP4 74.125.224.39\r\n"
"a=rtcp:3456 IN IP4 74.125.224.39\r\n"
"a=candidate:a0+B/1 2 udp 2130706432 192.168.1.5 1236 typ host "
- "generation 2\r\n"
+ "generation 2 username ufrag_video\r\n"
"a=candidate:a0+B/1 1 udp 2130706432 192.168.1.5 1237 typ host "
- "generation 2\r\n"
+ "generation 2 username ufrag_video\r\n"
"a=candidate:a0+B/2 2 udp 2130706432 ::1 1240 typ host "
- "generation 2\r\n"
+ "generation 2 username ufrag_video\r\n"
"a=candidate:a0+B/2 1 udp 2130706432 ::1 1241 typ host "
- "generation 2\r\n"
+ "generation 2 username ufrag_video\r\n"
"a=candidate:a0+B/4 2 udp 2130706432 74.125.224.39 3456 typ relay "
- "generation 2\r\n"
+ "generation 2 username ufrag_video\r\n"
"a=candidate:a0+B/4 1 udp 2130706432 74.125.224.39 3457 typ relay "
- "generation 2\r\n"
+ "generation 2 username ufrag_video\r\n"
"a=ice-ufrag:ufrag_video\r\na=ice-pwd:pwd_video\r\n"
"a=mid:video_content_name\r\n"
"a=sendrecv\r\n"
@@ -308,12 +308,12 @@ static const char kSdpSctpDataChannelWithCandidatesString[] =
"m=application 2345 DTLS/SCTP 5000\r\n"
"c=IN IP4 74.125.127.126\r\n"
"a=candidate:a0+B/1 1 udp 2130706432 192.168.1.5 1234 typ host "
- "generation 2\r\n"
+ "generation 2 username ufrag_data\r\n"
"a=candidate:a0+B/2 1 udp 2130706432 ::1 1238 typ host "
- "generation 2\r\n"
+ "generation 2 username ufrag_data\r\n"
"a=candidate:a0+B/3 1 udp 2130706432 74.125.127.126 2345 typ srflx "
"raddr 192.168.1.5 rport 2346 "
- "generation 2\r\n"
+ "generation 2 username ufrag_data\r\n"
"a=ice-ufrag:ufrag_data\r\n"
"a=ice-pwd:pwd_data\r\n"
"a=mid:data_content_name\r\n"
@@ -1721,6 +1721,13 @@ TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithExtmap) {
TEST_F(WebRtcSdpTest, SerializeCandidates) {
std::string message = webrtc::SdpSerializeCandidate(*jcandidate_);
EXPECT_EQ(std::string(kRawCandidate), message);
+
+ Candidate candidate_with_ufrag(candidates_.front());
+ candidate_with_ufrag.set_username("ABC");
+ jcandidate_.reset(new JsepIceCandidate(std::string("audio_content_name"), 0,
+ candidate_with_ufrag));
+ message = webrtc::SdpSerializeCandidate(*jcandidate_);
+ EXPECT_EQ(std::string(kRawCandidate) + " username ABC", message);
}
// TODO(mallinath) : Enable this test once WebRTCSdp capable of parsing

Powered by Google App Engine
This is Rietveld 408576698