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}
This commit is contained in:
parent
02c65869c3
commit
2d5f3cb933
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user