Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1029)

Unified Diff: webrtc/p2p/base/port_unittest.cc

Issue 1956453003: Relanding: Implement RTCConfiguration.iceCandidatePoolSize. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/p2p/base/port_unittest.cc
diff --git a/webrtc/p2p/base/port_unittest.cc b/webrtc/p2p/base/port_unittest.cc
index 7e787e08eb316c24053efdcf6dc39a21891db446..1eeae282b9ca1de05ff0927eac85b7132dfc872f 100644
--- a/webrtc/p2p/base/port_unittest.cc
+++ b/webrtc/p2p/base/port_unittest.cc
@@ -2586,3 +2586,20 @@ TEST_F(PortTest, TestSupportsProtocol) {
EXPECT_TRUE(turn_port->SupportsProtocol(UDP_PROTOCOL_NAME));
EXPECT_FALSE(turn_port->SupportsProtocol(TCP_PROTOCOL_NAME));
}
+
+// Test that SetTranpsortInformation updates the component, ufrag and password
+// on both the port itself and its candidates.
+TEST_F(PortTest, TestSetTransportInformation) {
+ std::unique_ptr<TestPort> port(
+ CreateTestPort(kLocalAddr1, "ufrag1", "password1"));
+ port->PrepareAddress();
+ EXPECT_EQ(1UL, port->Candidates().size());
+ port->SetTransportInformation(1, "ufrag2", "password2");
+ EXPECT_EQ(1, port->component());
+ EXPECT_EQ("ufrag2", port->username_fragment());
+ EXPECT_EQ("password2", port->password());
+ const Candidate& candidate = port->Candidates()[0];
+ EXPECT_EQ(1, candidate.component());
+ EXPECT_EQ("ufrag2", candidate.username());
+ EXPECT_EQ("password2", candidate.password());
+}

Powered by Google App Engine
This is Rietveld 408576698