Catching more errors when parsing ICE server URLs.
Every malformed URL should now produce an error message in JS, rather than silently failing and possibly printing a warning message to the console (and possibly crashing). Also added some unit tests, and made "ParseIceServers" public. BUG=445002 Review URL: https://codereview.webrtc.org/1344143002 Cr-Commit-Position: refs/heads/master@{#10186}
This commit is contained in:
@ -79,8 +79,6 @@ static const char kStunIceServerWithIPv4AddressWithoutPort[] = "stun:1.2.3.4";
|
||||
static const char kStunIceServerWithIPv6Address[] = "stun:[2401:fa00:4::]:1234";
|
||||
static const char kStunIceServerWithIPv6AddressWithoutPort[] =
|
||||
"stun:[2401:fa00:4::]";
|
||||
static const char kStunIceServerWithInvalidIPv6Address[] =
|
||||
"stun:[2401:fa00:4:::3478";
|
||||
static const char kTurnIceServerWithIPv6Address[] =
|
||||
"turn:test@[2401:fa00:4::]:1234";
|
||||
|
||||
@ -208,7 +206,6 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServers) {
|
||||
TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServersUrls) {
|
||||
PeerConnectionInterface::RTCConfiguration config;
|
||||
webrtc::PeerConnectionInterface::IceServer ice_server;
|
||||
ice_server.urls.push_back(""); // Empty URLs should be ignored.
|
||||
ice_server.urls.push_back(kStunIceServer);
|
||||
ice_server.urls.push_back(kTurnIceServer);
|
||||
ice_server.urls.push_back(kTurnIceServerWithTransport);
|
||||
@ -368,8 +365,6 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIPLiteralAddress) {
|
||||
config.servers.push_back(ice_server);
|
||||
ice_server.uri = kStunIceServerWithIPv6AddressWithoutPort;
|
||||
config.servers.push_back(ice_server);
|
||||
ice_server.uri = kStunIceServerWithInvalidIPv6Address;
|
||||
config.servers.push_back(ice_server);
|
||||
ice_server.uri = kTurnIceServerWithIPv6Address;
|
||||
ice_server.password = kTurnPassword;
|
||||
config.servers.push_back(ice_server);
|
||||
|
||||
Reference in New Issue
Block a user