| Index: talk/app/webrtc/peerconnectionendtoend_unittest.cc
|
| diff --git a/talk/app/webrtc/peerconnectionendtoend_unittest.cc b/talk/app/webrtc/peerconnectionendtoend_unittest.cc
|
| index ceabf04cf08378330cf2b481e6bfb9c5fad8a52f..7800a6724a14dcc08ca26771594b8c5113d73cf6 100644
|
| --- a/talk/app/webrtc/peerconnectionendtoend_unittest.cc
|
| +++ b/talk/app/webrtc/peerconnectionendtoend_unittest.cc
|
| @@ -48,6 +48,8 @@ using webrtc::PeerConnectionInterface;
|
|
|
| namespace {
|
|
|
| +const char kExternalGiceUfrag[] = "1234567890123456";
|
| +const char kExternalGicePwd[] = "123456789012345678901234";
|
| const size_t kMaxWait = 10000;
|
|
|
| void RemoveLinesFromSdp(const std::string& line_start,
|
| @@ -96,6 +98,24 @@ void UseExternalSdes(std::string* sdp) {
|
| InjectAfter("a=mid:data\r\n", kDataSdes, sdp);
|
| }
|
|
|
| +void UseGice(std::string* sdp) {
|
| + InjectAfter("t=0 0\r\n", "a=ice-options:google-ice\r\n", sdp);
|
| +
|
| + std::string ufragline = "a=ice-ufrag:";
|
| + std::string pwdline = "a=ice-pwd:";
|
| + RemoveLinesFromSdp(ufragline, sdp);
|
| + RemoveLinesFromSdp(pwdline, sdp);
|
| + ufragline.append(kExternalGiceUfrag);
|
| + ufragline.append("\r\n");
|
| + pwdline.append(kExternalGicePwd);
|
| + pwdline.append("\r\n");
|
| + const std::string ufrag_pwd = ufragline + pwdline;
|
| +
|
| + InjectAfter("a=mid:audio\r\n", ufrag_pwd, sdp);
|
| + InjectAfter("a=mid:video\r\n", ufrag_pwd, sdp);
|
| + InjectAfter("a=mid:data\r\n", ufrag_pwd, sdp);
|
| +}
|
| +
|
| void RemoveBundle(std::string* sdp) {
|
| RemoveLinesFromSdp("a=group:BUNDLE", sdp);
|
| }
|
| @@ -159,6 +179,37 @@ class PeerConnectionEndToEndTest
|
| callee_->WaitForConnection();
|
| }
|
|
|
| + void SetupLegacySdpConverter() {
|
| + caller_->SignalOnSdpCreated.connect(
|
| + this, &PeerConnectionEndToEndTest::ConvertToLegacySdp);
|
| + callee_->SignalOnSdpCreated.connect(
|
| + this, &PeerConnectionEndToEndTest::ConvertToLegacySdp);
|
| + }
|
| +
|
| + void ConvertToLegacySdp(std::string* sdp) {
|
| + UseExternalSdes(sdp);
|
| + UseGice(sdp);
|
| + RemoveBundle(sdp);
|
| + LOG(LS_INFO) << "ConvertToLegacySdp: " << *sdp;
|
| + }
|
| +
|
| + void SetupGiceConverter() {
|
| + caller_->SignalOnIceCandidateCreated.connect(
|
| + this, &PeerConnectionEndToEndTest::AddGiceCredsToCandidate);
|
| + callee_->SignalOnIceCandidateCreated.connect(
|
| + this, &PeerConnectionEndToEndTest::AddGiceCredsToCandidate);
|
| + }
|
| +
|
| + void AddGiceCredsToCandidate(std::string* sdp) {
|
| + std::string gice_creds = " username ";
|
| + gice_creds.append(kExternalGiceUfrag);
|
| + gice_creds.append(" password ");
|
| + gice_creds.append(kExternalGicePwd);
|
| + gice_creds.append("\r\n");
|
| + Replace("\r\n", gice_creds, sdp);
|
| + LOG(LS_INFO) << "AddGiceCredsToCandidate: " << *sdp;
|
| + }
|
| +
|
| void OnCallerAddedDataChanel(DataChannelInterface* dc) {
|
| caller_signaled_data_channels_.push_back(dc);
|
| }
|
| @@ -230,6 +281,8 @@ TEST_F(PeerConnectionEndToEndTest, DISABLED_CallWithLegacySdp) {
|
| pc_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp,
|
| false);
|
| CreatePcs(&pc_constraints);
|
| + SetupLegacySdpConverter();
|
| + SetupGiceConverter();
|
| GetAndAddUserMedia();
|
| Negotiate();
|
| WaitForCallEstablished();
|
|
|