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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « webrtc/api/peerconnection.cc ('k') | webrtc/p2p/base/portallocator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after
2159 config.type = PeerConnectionInterface::kRelay; 2159 config.type = PeerConnectionInterface::kRelay;
2160 EXPECT_TRUE(pc_->SetConfiguration(config)); 2160 EXPECT_TRUE(pc_->SetConfiguration(config));
2161 2161
2162 const cricket::FakePortAllocatorSession* session = 2162 const cricket::FakePortAllocatorSession* session =
2163 static_cast<const cricket::FakePortAllocatorSession*>( 2163 static_cast<const cricket::FakePortAllocatorSession*>(
2164 port_allocator_->GetPooledSession()); 2164 port_allocator_->GetPooledSession());
2165 ASSERT_NE(nullptr, session); 2165 ASSERT_NE(nullptr, session);
2166 EXPECT_EQ(1UL, session->stun_servers().size()); 2166 EXPECT_EQ(1UL, session->stun_servers().size());
2167 } 2167 }
2168 2168
2169 // Test that after SetLocalDescription, changing the pool size is not allowed.
2170 TEST_F(PeerConnectionInterfaceTest,
2171 CantChangePoolSizeAfterSetLocalDescription) {
2172 CreatePeerConnection();
2173 // Start by setting a size of 1.
2174 PeerConnectionInterface::RTCConfiguration config;
2175 config.ice_candidate_pool_size = 1;
2176 EXPECT_TRUE(pc_->SetConfiguration(config));
2177
2178 // Set remote offer; can still change pool size at this point.
2179 CreateOfferAsRemoteDescription();
2180 config.ice_candidate_pool_size = 2;
2181 EXPECT_TRUE(pc_->SetConfiguration(config));
2182
2183 // Set local answer; now it's too late.
2184 CreateAnswerAsLocalDescription();
2185 config.ice_candidate_pool_size = 3;
2186 EXPECT_FALSE(pc_->SetConfiguration(config));
2187 }
2188
2169 // Test that PeerConnection::Close changes the states to closed and all remote 2189 // Test that PeerConnection::Close changes the states to closed and all remote
2170 // tracks change state to ended. 2190 // tracks change state to ended.
2171 TEST_F(PeerConnectionInterfaceTest, CloseAndTestStreamsAndStates) { 2191 TEST_F(PeerConnectionInterfaceTest, CloseAndTestStreamsAndStates) {
2172 // Initialize a PeerConnection and negotiate local and remote session 2192 // Initialize a PeerConnection and negotiate local and remote session
2173 // description. 2193 // description.
2174 InitiateCall(); 2194 InitiateCall();
2175 ASSERT_EQ(1u, pc_->local_streams()->count()); 2195 ASSERT_EQ(1u, pc_->local_streams()->count());
2176 ASSERT_EQ(1u, pc_->remote_streams()->count()); 2196 ASSERT_EQ(1u, pc_->remote_streams()->count());
2177 2197
2178 pc_->Close(); 2198 pc_->Close();
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
2982 FakeConstraints updated_answer_c; 3002 FakeConstraints updated_answer_c;
2983 answer_c.SetMandatoryReceiveAudio(false); 3003 answer_c.SetMandatoryReceiveAudio(false);
2984 answer_c.SetMandatoryReceiveVideo(false); 3004 answer_c.SetMandatoryReceiveVideo(false);
2985 3005
2986 cricket::MediaSessionOptions updated_answer_options; 3006 cricket::MediaSessionOptions updated_answer_options;
2987 EXPECT_TRUE( 3007 EXPECT_TRUE(
2988 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); 3008 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options));
2989 EXPECT_TRUE(updated_answer_options.has_audio()); 3009 EXPECT_TRUE(updated_answer_options.has_audio());
2990 EXPECT_TRUE(updated_answer_options.has_video()); 3010 EXPECT_TRUE(updated_answer_options.has_video());
2991 } 3011 }
OLDNEW
« 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