| Index: webrtc/pc/peerconnection_integrationtest.cc
|
| diff --git a/webrtc/pc/peerconnection_integrationtest.cc b/webrtc/pc/peerconnection_integrationtest.cc
|
| index 0ee4cbd7193e9bc5ef33aa6c4ba83ea413da0d72..b5a988326f6d6ed45f6089978b3f3395d63a9e0a 100644
|
| --- a/webrtc/pc/peerconnection_integrationtest.cc
|
| +++ b/webrtc/pc/peerconnection_integrationtest.cc
|
| @@ -2297,6 +2297,36 @@ TEST_F(PeerConnectionIntegrationTest, EndToEndCallWithSctpDataChannel) {
|
| kDefaultTimeout);
|
| }
|
|
|
| +// This test sets up a call between two parties with an SCTP data channel only.
|
| +TEST_F(PeerConnectionIntegrationTest, EndToEndCallWithSctpDataChannelOnly) {
|
| + ASSERT_TRUE(CreatePeerConnectionWrappers());
|
| + ConnectFakeSignaling();
|
| + // Expect that data channel created on caller side will show up for callee as
|
| + // well.
|
| + caller()->CreateDataChannel();
|
| + PeerConnectionInterface::RTCOfferAnswerOptions options;
|
| + options.offer_to_receive_audio = 0;
|
| + options.offer_to_receive_video = 0;
|
| + caller()->SetOfferAnswerOptions(options);
|
| + caller()->CreateAndSetAndSignalOffer();
|
| + ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
|
| + // Caller data channel should already exist (it created one). Callee data
|
| + // channel may not exist yet, since negotiation happens in-band, not in SDP.
|
| + ASSERT_NE(nullptr, caller()->data_channel());
|
| + 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);
|
| +}
|
| +
|
| // Ensure that when the callee closes an SCTP data channel, the closing
|
| // procedure results in the data channel being closed for the caller as well.
|
| TEST_F(PeerConnectionIntegrationTest, CalleeClosesSctpDataChannel) {
|
|
|