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

Side by Side Diff: webrtc/api/webrtcsession_unittest.cc

Issue 2025573002: Use continual gathering to restore backup connections (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address comments and revised tests Created 4 years, 5 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
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 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after
2235 candidates = local_desc->candidates(kMediaContentIndex0); 2235 candidates = local_desc->candidates(kMediaContentIndex0);
2236 ASSERT_TRUE(candidates != NULL); 2236 ASSERT_TRUE(candidates != NULL);
2237 EXPECT_LT(0u, candidates->count()); 2237 EXPECT_LT(0u, candidates->count());
2238 candidates = local_desc->candidates(1); 2238 candidates = local_desc->candidates(1);
2239 ASSERT_TRUE(candidates != NULL); 2239 ASSERT_TRUE(candidates != NULL);
2240 EXPECT_EQ(0u, candidates->count()); 2240 EXPECT_EQ(0u, candidates->count());
2241 2241
2242 candidates = local_desc->candidates(kMediaContentIndex0); 2242 candidates = local_desc->candidates(kMediaContentIndex0);
2243 size_t num_local_candidates = candidates->count(); 2243 size_t num_local_candidates = candidates->count();
2244 // Enable Continual Gathering 2244 // Enable Continual Gathering
2245 session_->SetIceConfig(cricket::IceConfig(-1, -1, true, false, -1, true)); 2245 cricket::IceConfig config;
2246 config.continual_gathering_policy = cricket::GATHER_CONTINUALLY;
2247 config.presume_writable_when_fully_relayed = true;
Taylor Brandstetter 2016/06/29 22:12:27 I don't think presume_writable_when_fully_relayed
honghaiz3 2016/06/30 01:04:21 Done.
2248 session_->SetIceConfig(config);
2246 // Bring down the network interface to trigger candidate removals. 2249 // Bring down the network interface to trigger candidate removals.
2247 RemoveInterface(rtc::SocketAddress(kClientAddrHost1, kClientAddrPort)); 2250 RemoveInterface(rtc::SocketAddress(kClientAddrHost1, kClientAddrPort));
2248 // Verify that all local candidates are removed. 2251 // Verify that all local candidates are removed.
2249 EXPECT_EQ(0, observer_.num_candidates_removed_); 2252 EXPECT_EQ(0, observer_.num_candidates_removed_);
2250 EXPECT_EQ_WAIT(num_local_candidates, observer_.num_candidates_removed_, 2253 EXPECT_EQ_WAIT(num_local_candidates, observer_.num_candidates_removed_,
2251 kIceCandidatesTimeout); 2254 kIceCandidatesTimeout);
2252 EXPECT_EQ_WAIT(0u, candidates->count(), kIceCandidatesTimeout); 2255 EXPECT_EQ_WAIT(0u, candidates->count(), kIceCandidatesTimeout);
2253 } 2256 }
2254 2257
2255 // Tests that if continual gathering is disabled, local candidates won't be 2258 // Tests that if continual gathering is disabled, local candidates won't be
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after
4257 } 4260 }
4258 4261
4259 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test 4262 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test
4260 // currently fails because upon disconnection and reconnection OnIceComplete is 4263 // currently fails because upon disconnection and reconnection OnIceComplete is
4261 // called more than once without returning to IceGatheringGathering. 4264 // called more than once without returning to IceGatheringGathering.
4262 4265
4263 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, 4266 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests,
4264 WebRtcSessionTest, 4267 WebRtcSessionTest,
4265 testing::Values(ALREADY_GENERATED, 4268 testing::Values(ALREADY_GENERATED,
4266 DTLS_IDENTITY_STORE)); 4269 DTLS_IDENTITY_STORE));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698