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

Unified Diff: webrtc/api/peerconnectioninterface_unittest.cc

Issue 2566833002: Don't allow changing ICE pool size after SetLocalDescription. (Closed)
Patch Set: Fixing signed/unsigned compare warning. Created 4 years 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/api/peerconnection.cc ('k') | webrtc/p2p/base/portallocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnectioninterface_unittest.cc
diff --git a/webrtc/api/peerconnectioninterface_unittest.cc b/webrtc/api/peerconnectioninterface_unittest.cc
index d673b4174a93a7a46aa2771477073b4c0b22ffe1..5a0e51d735ba61f0a07592c44f81c519ceb03210 100644
--- a/webrtc/api/peerconnectioninterface_unittest.cc
+++ b/webrtc/api/peerconnectioninterface_unittest.cc
@@ -2166,6 +2166,26 @@ TEST_F(PeerConnectionInterfaceTest,
EXPECT_EQ(1UL, session->stun_servers().size());
}
+// Test that after SetLocalDescription, changing the pool size is not allowed.
+TEST_F(PeerConnectionInterfaceTest,
+ CantChangePoolSizeAfterSetLocalDescription) {
+ CreatePeerConnection();
+ // Start by setting a size of 1.
+ PeerConnectionInterface::RTCConfiguration config;
+ config.ice_candidate_pool_size = 1;
+ EXPECT_TRUE(pc_->SetConfiguration(config));
+
+ // Set remote offer; can still change pool size at this point.
+ CreateOfferAsRemoteDescription();
+ config.ice_candidate_pool_size = 2;
+ EXPECT_TRUE(pc_->SetConfiguration(config));
+
+ // Set local answer; now it's too late.
+ CreateAnswerAsLocalDescription();
+ config.ice_candidate_pool_size = 3;
+ EXPECT_FALSE(pc_->SetConfiguration(config));
+}
+
// Test that PeerConnection::Close changes the states to closed and all remote
// tracks change state to ended.
TEST_F(PeerConnectionInterfaceTest, CloseAndTestStreamsAndStates) {
« no previous file with comments | « webrtc/api/peerconnection.cc ('k') | webrtc/p2p/base/portallocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698