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) { |