Index: webrtc/pc/peerconnection_integrationtest.cc |
diff --git a/webrtc/pc/peerconnection_integrationtest.cc b/webrtc/pc/peerconnection_integrationtest.cc |
index d818300c23f1fe4846d899b3eab589ced74fe771..3c86143f4fb0c429805dd80dcab8b185377b6356 100644 |
--- a/webrtc/pc/peerconnection_integrationtest.cc |
+++ b/webrtc/pc/peerconnection_integrationtest.cc |
@@ -2336,6 +2336,34 @@ TEST_F(PeerConnectionIntegrationTest, AddSctpDataChannelInSubsequentOffer) { |
kDefaultTimeout); |
} |
+// Set up a connection initially just using SCTP data channels, later upgrading |
+// to audio/video, ensuring frames are received end-to-end. Effectively the |
+// inverse of the test above. |
+// This was broken in M57; see https://crbug.com/711243 |
+TEST_F(PeerConnectionIntegrationTest, SctpDataChannelToAudioVideoUpgrade) { |
+ ASSERT_TRUE(CreatePeerConnectionWrappers()); |
+ ConnectFakeSignaling(); |
+ // Do initial offer/answer with just data channel. |
+ caller()->CreateDataChannel(); |
+ caller()->CreateAndSetAndSignalOffer(); |
+ ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); |
+ // Wait until data can be sent over the data channel. |
+ ASSERT_TRUE_WAIT(callee()->data_channel() != nullptr, kDefaultTimeout); |
+ ASSERT_TRUE_WAIT(caller()->data_observer()->IsOpen(), kDefaultTimeout); |
+ ASSERT_TRUE_WAIT(callee()->data_observer()->IsOpen(), kDefaultTimeout); |
+ |
+ // Do subsequent offer/answer with two-way audio and video. Audio and video |
+ // should end up bundled on the DTLS/ICE transport already used for data. |
+ caller()->AddAudioVideoMediaStream(); |
+ callee()->AddAudioVideoMediaStream(); |
+ caller()->CreateAndSetAndSignalOffer(); |
+ ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout); |
+ ExpectNewFramesReceivedWithWait( |
+ kDefaultExpectedAudioFrameCount, kDefaultExpectedVideoFrameCount, |
+ kDefaultExpectedAudioFrameCount, kDefaultExpectedVideoFrameCount, |
+ kMaxWaitForFramesMs); |
+} |
+ |
#endif // HAVE_SCTP |
// Test that the ICE connection and gathering states eventually reach |