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

Unified Diff: webrtc/pc/peerconnection_integrationtest.cc

Issue 2902213002: Support "UDP/DTLS/SCTP" and "TCP/DTLS/SCTP" profile strings. (Closed)
Patch Set: Created 3 years, 7 months 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
« webrtc/pc/mediasession.cc ('K') | « webrtc/pc/mediasession_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/peerconnection_integrationtest.cc
diff --git a/webrtc/pc/peerconnection_integrationtest.cc b/webrtc/pc/peerconnection_integrationtest.cc
index e6c3cf1f5781f18e493cbbb7f7d0cf3b83a6b6fc..12b99b49020ab44cc9f78c05534053be54ef6213 100644
--- a/webrtc/pc/peerconnection_integrationtest.cc
+++ b/webrtc/pc/peerconnection_integrationtest.cc
@@ -2482,6 +2482,40 @@ TEST_F(PeerConnectionIntegrationTest, SctpDataChannelToAudioVideoUpgrade) {
kMaxWaitForFramesMs);
}
+static void MakeSpecCompliantSctpOffer(cricket::SessionDescription* desc) {
+ const ContentInfo* dc_offer = GetFirstDataContent(desc);
+ ASSERT_NE(nullptr, dc_offer);
+ cricket::DataContentDescription* dcd_offer =
+ static_cast<cricket::DataContentDescription*>(dc_offer->description);
+ dcd_offer->set_use_sctpmap(false);
+ dcd_offer->set_protocol("UDP/DTLS/SCTP");
+}
+
+// Test that the data channel works when a spec-compliant SCTP m= section is
+// offered (using "a=sctp-port" instead of "a=sctpmap", and using
+// "UDP/DTLS/SCTP" as the protocol).
+TEST_F(PeerConnectionIntegrationTest,
+ DataChannelWorksWhenSpecCompliantSctpOfferReceived) {
+ ASSERT_TRUE(CreatePeerConnectionWrappers());
+ ConnectFakeSignaling();
+ caller()->CreateDataChannel();
+ caller()->SetGeneratedSdpMunger(MakeSpecCompliantSctpOffer);
+ caller()->CreateAndSetAndSignalOffer();
+ ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
+ ASSERT_TRUE_WAIT(callee()->data_channel() != nullptr, kDefaultTimeout);
+ EXPECT_TRUE_WAIT(caller()->data_observer()->IsOpen(), kDefaultTimeout);
+ EXPECT_TRUE_WAIT(callee()->data_observer()->IsOpen(), kDefaultTimeout);
+
+ // Ensure data can be sent in both directions.
+ std::string data = "hello world";
+ caller()->data_channel()->Send(DataBuffer(data));
+ EXPECT_EQ_WAIT(data, callee()->data_observer()->last_message(),
+ kDefaultTimeout);
+ callee()->data_channel()->Send(DataBuffer(data));
+ EXPECT_EQ_WAIT(data, caller()->data_observer()->last_message(),
+ kDefaultTimeout);
+}
+
#endif // HAVE_SCTP
// Test that the ICE connection and gathering states eventually reach
« webrtc/pc/mediasession.cc ('K') | « webrtc/pc/mediasession_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698