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

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

Issue 2812173003: Fixing bug that results in incorrect ICE role with ICE lite endpoints. (Closed)
Patch Set: Addressing Zhi's comment Created 3 years, 8 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
« no previous file with comments | « webrtc/p2p/base/transportcontroller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/transportcontroller_unittest.cc
diff --git a/webrtc/p2p/base/transportcontroller_unittest.cc b/webrtc/p2p/base/transportcontroller_unittest.cc
index 44ad54dcbe6d154a7357c919b9b001b09bfbb339..239bb2a2357dbfb8df0e6b0665bfc67e8855c2e6 100644
--- a/webrtc/p2p/base/transportcontroller_unittest.cc
+++ b/webrtc/p2p/base/transportcontroller_unittest.cc
@@ -834,6 +834,37 @@ TEST_F(TransportControllerTest, TestSetRemoteIceLiteInAnswer) {
EXPECT_EQ(ICEMODE_LITE, transport->fake_ice_transport()->remote_ice_mode());
}
+// Tests that the ICE role remains "controlling" if a subsequent offer that
+// does an ICE restart is received from an ICE lite endpoint. Regression test
+// for: https://crbug.com/710760
+TEST_F(TransportControllerTest,
+ IceRoleIsControllingAfterIceRestartFromIceLiteEndpoint) {
+ FakeDtlsTransport* transport = CreateFakeDtlsTransport("audio", 1);
+ ASSERT_NE(nullptr, transport);
+ std::string err;
+
+ // Initial offer/answer.
+ TransportDescription remote_desc(std::vector<std::string>(), kIceUfrag1,
+ kIcePwd1, ICEMODE_LITE,
+ CONNECTIONROLE_ACTPASS, nullptr);
+ TransportDescription local_desc(kIceUfrag1, kIcePwd1);
+ ASSERT_TRUE(transport_controller_->SetRemoteTransportDescription(
+ "audio", remote_desc, CA_OFFER, &err));
+ ASSERT_TRUE(transport_controller_->SetLocalTransportDescription(
+ "audio", local_desc, CA_ANSWER, nullptr));
+ // Subsequent ICE restart offer/answer.
+ remote_desc.ice_ufrag = kIceUfrag2;
+ remote_desc.ice_pwd = kIcePwd2;
+ local_desc.ice_ufrag = kIceUfrag2;
+ local_desc.ice_pwd = kIcePwd2;
+ ASSERT_TRUE(transport_controller_->SetRemoteTransportDescription(
+ "audio", remote_desc, CA_OFFER, &err));
+ ASSERT_TRUE(transport_controller_->SetLocalTransportDescription(
+ "audio", local_desc, CA_ANSWER, nullptr));
+
+ EXPECT_EQ(ICEROLE_CONTROLLING, transport->fake_ice_transport()->GetIceRole());
+}
+
// Tests SetNeedsIceRestartFlag and NeedsIceRestart, setting the flag and then
// initiating an ICE restart for one of the transports.
TEST_F(TransportControllerTest, NeedsIceRestart) {
« no previous file with comments | « webrtc/p2p/base/transportcontroller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698