Revert of Adding error output param to SetConfiguration, using new RTCError type. (patchset #4 id:60001 of https://codereview.webrtc.org/2587133004/ )
Reason for revert:
Broke chromium FYI bot because the chromium mock PC overrides the method whose signature is changing.
Also broke a downstream internal test, which I need to investigate further.
Original issue's description:
> Adding error output param to SetConfiguration, using new RTCError type.
>
> Most notably, will return "INVALID_MODIFICATION" if a field in the
> configuration was modified and modification of that field isn't supported.
>
> Also changing RTCError to a class that wraps an enum type, because it will
> eventually need to hold other information (like SDP line number), to match
> the RTCError that was recently added to the spec:
> https://github.com/w3c/webrtc-pc/pull/850
>
> BUG=webrtc:6916
>
> Review-Url: https://codereview.webrtc.org/2587133004
> Cr-Commit-Position: refs/heads/master@{#15777}
> Committed: https://chromium.googlesource.com/external/webrtc/+/7a5fa6cd6173adbe32aedc1aedc872478121f5ed
TBR=pthatcher@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6916
Review-Url: https://codereview.webrtc.org/2600813002
Cr-Commit-Position: refs/heads/master@{#15778}
diff --git a/webrtc/api/peerconnection_unittest.cc b/webrtc/api/peerconnection_unittest.cc
index c8dc121..4f34cfa 100644
--- a/webrtc/api/peerconnection_unittest.cc
+++ b/webrtc/api/peerconnection_unittest.cc
@@ -2620,10 +2620,6 @@
return ParseUrl(url, std::string(), std::string());
}
- bool ParseTurnUrl(const std::string& url) {
- return ParseUrl(url, "username", "password");
- }
-
bool ParseUrl(const std::string& url,
const std::string& username,
const std::string& password) {
@@ -2633,8 +2629,7 @@
server.username = username;
server.password = password;
servers.push_back(server);
- return webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_) ==
- webrtc::RTCErrorType::NONE;
+ return webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_);
}
protected:
@@ -2654,13 +2649,13 @@
EXPECT_EQ(0U, turn_servers_.size());
stun_servers_.clear();
- EXPECT_TRUE(ParseTurnUrl("turn:hostname"));
+ EXPECT_TRUE(ParseUrl("turn:hostname"));
EXPECT_EQ(0U, stun_servers_.size());
EXPECT_EQ(1U, turn_servers_.size());
EXPECT_EQ(cricket::PROTO_UDP, turn_servers_[0].ports[0].proto);
turn_servers_.clear();
- EXPECT_TRUE(ParseTurnUrl("turns:hostname"));
+ EXPECT_TRUE(ParseUrl("turns:hostname"));
EXPECT_EQ(0U, stun_servers_.size());
EXPECT_EQ(1U, turn_servers_.size());
EXPECT_EQ(cricket::PROTO_TLS, turn_servers_[0].ports[0].proto);
@@ -2675,14 +2670,14 @@
TEST_F(IceServerParsingTest, VerifyDefaults) {
// TURNS defaults
- EXPECT_TRUE(ParseTurnUrl("turns:hostname"));
+ EXPECT_TRUE(ParseUrl("turns:hostname"));
EXPECT_EQ(1U, turn_servers_.size());
EXPECT_EQ(5349, turn_servers_[0].ports[0].address.port());
EXPECT_EQ(cricket::PROTO_TLS, turn_servers_[0].ports[0].proto);
turn_servers_.clear();
// TURN defaults
- EXPECT_TRUE(ParseTurnUrl("turn:hostname"));
+ EXPECT_TRUE(ParseUrl("turn:hostname"));
EXPECT_EQ(1U, turn_servers_.size());
EXPECT_EQ(3478, turn_servers_[0].ports[0].address.port());
EXPECT_EQ(cricket::PROTO_UDP, turn_servers_[0].ports[0].proto);
@@ -2747,33 +2742,33 @@
// Test parsing the "?transport=xxx" part of the URL.
TEST_F(IceServerParsingTest, ParseTransport) {
- EXPECT_TRUE(ParseTurnUrl("turn:hostname:1234?transport=tcp"));
+ EXPECT_TRUE(ParseUrl("turn:hostname:1234?transport=tcp"));
EXPECT_EQ(1U, turn_servers_.size());
EXPECT_EQ(cricket::PROTO_TCP, turn_servers_[0].ports[0].proto);
turn_servers_.clear();
- EXPECT_TRUE(ParseTurnUrl("turn:hostname?transport=udp"));
+ EXPECT_TRUE(ParseUrl("turn:hostname?transport=udp"));
EXPECT_EQ(1U, turn_servers_.size());
EXPECT_EQ(cricket::PROTO_UDP, turn_servers_[0].ports[0].proto);
turn_servers_.clear();
- EXPECT_FALSE(ParseTurnUrl("turn:hostname?transport=invalid"));
- EXPECT_FALSE(ParseTurnUrl("turn:hostname?transport="));
- EXPECT_FALSE(ParseTurnUrl("turn:hostname?="));
- EXPECT_FALSE(ParseTurnUrl("?"));
+ EXPECT_FALSE(ParseUrl("turn:hostname?transport=invalid"));
+ EXPECT_FALSE(ParseUrl("turn:hostname?transport="));
+ EXPECT_FALSE(ParseUrl("turn:hostname?="));
+ EXPECT_FALSE(ParseUrl("?"));
}
// Test parsing ICE username contained in URL.
TEST_F(IceServerParsingTest, ParseUsername) {
- EXPECT_TRUE(ParseTurnUrl("turn:user@hostname"));
+ EXPECT_TRUE(ParseUrl("turn:user@hostname"));
EXPECT_EQ(1U, turn_servers_.size());
EXPECT_EQ("user", turn_servers_[0].credentials.username);
turn_servers_.clear();
- EXPECT_FALSE(ParseTurnUrl("turn:@hostname"));
- EXPECT_FALSE(ParseTurnUrl("turn:username@"));
- EXPECT_FALSE(ParseTurnUrl("turn:@"));
- EXPECT_FALSE(ParseTurnUrl("turn:user@name@hostname"));
+ EXPECT_FALSE(ParseUrl("turn:@hostname"));
+ EXPECT_FALSE(ParseUrl("turn:username@"));
+ EXPECT_FALSE(ParseUrl("turn:@"));
+ EXPECT_FALSE(ParseUrl("turn:user@name@hostname"));
}
// Test that username and password from IceServer is copied into the resulting
@@ -2791,11 +2786,8 @@
PeerConnectionInterface::IceServer server;
server.urls.push_back("stun:hostname");
server.urls.push_back("turn:hostname");
- server.username = "foo";
- server.password = "bar";
servers.push_back(server);
- EXPECT_EQ(webrtc::RTCErrorType::NONE,
- webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_));
+ EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_));
EXPECT_EQ(1U, stun_servers_.size());
EXPECT_EQ(1U, turn_servers_.size());
}
@@ -2807,11 +2799,8 @@
PeerConnectionInterface::IceServer server;
server.urls.push_back("turn:hostname");
server.urls.push_back("turn:hostname2");
- server.username = "foo";
- server.password = "bar";
servers.push_back(server);
- EXPECT_EQ(webrtc::RTCErrorType::NONE,
- webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_));
+ EXPECT_TRUE(webrtc::ParseIceServers(servers, &stun_servers_, &turn_servers_));
EXPECT_EQ(2U, turn_servers_.size());
EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority);
}