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

Side by Side Diff: webrtc/pc/peerconnectioninterface_unittest.cc

Issue 2677503004: Allow changing the minimal ICE ping timeout with PeerConnection.SetConfiguration. (Closed)
Patch Set: unit tests Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « webrtc/pc/peerconnection.cc ('k') | no next file » | 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 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after
2214 PeerConnectionInterface::RTCConfiguration config; 2214 PeerConnectionInterface::RTCConfiguration config;
2215 config.prune_turn_ports = false; 2215 config.prune_turn_ports = false;
2216 CreatePeerConnection(config, nullptr); 2216 CreatePeerConnection(config, nullptr);
2217 EXPECT_FALSE(port_allocator_->prune_turn_ports()); 2217 EXPECT_FALSE(port_allocator_->prune_turn_ports());
2218 2218
2219 config.prune_turn_ports = true; 2219 config.prune_turn_ports = true;
2220 EXPECT_TRUE(pc_->SetConfiguration(config)); 2220 EXPECT_TRUE(pc_->SetConfiguration(config));
2221 EXPECT_TRUE(port_allocator_->prune_turn_ports()); 2221 EXPECT_TRUE(port_allocator_->prune_turn_ports());
2222 } 2222 }
2223 2223
2224 // Test that the ice check interval can be changed. This does not verify that
2225 // the setting makes it all the way to P2PTransportChannel, as that would
2226 // require a very complex set of mocks.
2227 TEST_F(PeerConnectionInterfaceTest, SetConfigurationChangesIceCheckInterval) {
2228 PeerConnectionInterface::RTCConfiguration config;
2229 config.ice_check_min_interval = rtc::Optional<int>();
2230 CreatePeerConnection(config, nullptr);
2231 config.ice_check_min_interval = rtc::Optional<int>(100);
2232 EXPECT_TRUE(pc_->SetConfiguration(config));
2233 PeerConnectionInterface::RTCConfiguration new_config =
2234 pc_->GetConfiguration();
2235 EXPECT_TRUE(new_config.ice_check_min_interval);
Taylor Brandstetter 2017/02/03 23:56:17 nit: ASSERT_TRUE, since the next line will crash i
skvlad 2017/02/04 00:01:51 I'm now comparing it with rtc::Optional<int>(100).
2236 EXPECT_EQ(*new_config.ice_check_min_interval, 100);
2237 }
2238
2224 // Test that when SetConfiguration changes both the pool size and other 2239 // Test that when SetConfiguration changes both the pool size and other
2225 // attributes, the pooled session is created with the updated attributes. 2240 // attributes, the pooled session is created with the updated attributes.
2226 TEST_F(PeerConnectionInterfaceTest, 2241 TEST_F(PeerConnectionInterfaceTest,
2227 SetConfigurationCreatesPooledSessionCorrectly) { 2242 SetConfigurationCreatesPooledSessionCorrectly) {
2228 CreatePeerConnection(); 2243 CreatePeerConnection();
2229 PeerConnectionInterface::RTCConfiguration config; 2244 PeerConnectionInterface::RTCConfiguration config;
2230 config.ice_candidate_pool_size = 1; 2245 config.ice_candidate_pool_size = 1;
2231 PeerConnectionInterface::IceServer server; 2246 PeerConnectionInterface::IceServer server;
2232 server.uri = kStunAddressOnly; 2247 server.uri = kStunAddressOnly;
2233 config.servers.push_back(server); 2248 config.servers.push_back(server);
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
3381 EXPECT_NE(a, f); 3396 EXPECT_NE(a, f);
3382 3397
3383 PeerConnectionInterface::RTCConfiguration g; 3398 PeerConnectionInterface::RTCConfiguration g;
3384 g.disable_ipv6 = true; 3399 g.disable_ipv6 = true;
3385 EXPECT_NE(a, g); 3400 EXPECT_NE(a, g);
3386 3401
3387 PeerConnectionInterface::RTCConfiguration h( 3402 PeerConnectionInterface::RTCConfiguration h(
3388 PeerConnectionInterface::RTCConfigurationType::kAggressive); 3403 PeerConnectionInterface::RTCConfigurationType::kAggressive);
3389 EXPECT_NE(a, h); 3404 EXPECT_NE(a, h);
3390 } 3405 }
OLDNEW
« no previous file with comments | « webrtc/pc/peerconnection.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698