aboutsummaryrefslogtreecommitdiff
path: root/pc
diff options
context:
space:
mode:
authorBenjamin Wright <benwright@webrtc.org>2018-05-22 14:46:06 -0700
committerCommit Bot <commit-bot@chromium.org>2018-05-23 00:28:39 +0000
commit2d5f3cb93336b0fcd2e3efff2671b2a034821f64 (patch)
tree67ef4a571c0060a1f865c64ccdd4a21eea385d28 /pc
parent02c65869c3bae25567eb2681ec78bb1f6d2322c9 (diff)
downloadwebrtc-2d5f3cb93336b0fcd2e3efff2671b2a034821f64.tar.gz
Added an integration test to validate TURN servers can send media in relay mode.
End to end test for media sent over a TCP TURN server with both clients in relay This test validates that media can be sent between two clients who are set up to relay information with the server configured to use TCP instead of UDP. Bug: webrtc:7668 Change-Id: I3efd04048589c144494f90f2cdf3df5f9f80300e Reviewed-on: https://webrtc-review.googlesource.com/76507 Commit-Queue: Benjamin Wright <benwright@webrtc.org> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23354}
Diffstat (limited to 'pc')
-rw-r--r--pc/peerconnection_integrationtest.cc42
1 files changed, 42 insertions, 0 deletions
diff --git a/pc/peerconnection_integrationtest.cc b/pc/peerconnection_integrationtest.cc
index 28b7d16b91..8e8edda1ea 100644
--- a/pc/peerconnection_integrationtest.cc
+++ b/pc/peerconnection_integrationtest.cc
@@ -3852,6 +3852,48 @@ TEST_P(PeerConnectionIntegrationTest, TurnCustomizerUsedForTurnConnections) {
delete SetCalleePcWrapperAndReturnCurrent(nullptr);
}
+// Verifies that you can use TCP instead of UDP to connect to a TURN server and
+// send media between the caller and the callee.
+TEST_P(PeerConnectionIntegrationTest, TCPUsedForTurnConnections) {
+ static const rtc::SocketAddress turn_server_internal_address{"88.88.88.0",
+ 3478};
+ static const rtc::SocketAddress turn_server_external_address{"88.88.88.1", 0};
+
+ // Enable TCP for the fake turn server.
+ cricket::TestTurnServer turn_server(
+ network_thread(), turn_server_internal_address,
+ turn_server_external_address, cricket::PROTO_TCP);
+
+ webrtc::PeerConnectionInterface::IceServer ice_server;
+ ice_server.urls.push_back("turn:88.88.88.0:3478?transport=tcp");
+ ice_server.username = "test";
+ ice_server.password = "test";
+
+ PeerConnectionInterface::RTCConfiguration client_1_config;
+ client_1_config.servers.push_back(ice_server);
+ client_1_config.type = webrtc::PeerConnectionInterface::kRelay;
+
+ PeerConnectionInterface::RTCConfiguration client_2_config;
+ client_2_config.servers.push_back(ice_server);
+ client_2_config.type = webrtc::PeerConnectionInterface::kRelay;
+
+ ASSERT_TRUE(
+ CreatePeerConnectionWrappersWithConfig(client_1_config, client_2_config));
+
+ // Do normal offer/answer and wait for ICE to complete.
+ ConnectFakeSignaling();
+ caller()->AddAudioVideoTracks();
+ callee()->AddAudioVideoTracks();
+ caller()->CreateAndSetAndSignalOffer();
+ ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
+ EXPECT_EQ_WAIT(webrtc::PeerConnectionInterface::kIceConnectionConnected,
+ callee()->ice_connection_state(), kMaxWaitForFramesMs);
+
+ MediaExpectations media_expectations;
+ media_expectations.ExpectBidirectionalAudioAndVideo();
+ EXPECT_TRUE(ExpectNewFrames(media_expectations));
+}
+
// Verify that a SSLCertificateVerifier passed in through
// PeerConnectionDependencies is actually used by the underlying SSL
// implementation to determine whether a certificate presented by the TURN