Remove iceRegatherIntervalRange

This was an ICE configuration experiment added a couple years ago that did not end up being used.

Bug: webrtc:11316
Change-Id: Iafb7e1c4f7b4598815f045808dbf6e470172f119
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/167680
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30395}
This commit is contained in:
Steve Anton
2020-01-27 15:45:02 -08:00
committed by Commit Bot
parent ed9a401f27
commit f417238217
31 changed files with 34 additions and 715 deletions

View File

@ -54,7 +54,8 @@ class RegatheringControllerTest : public ::testing::Test,
ice_transport_(new cricket::MockIceTransport()),
allocator_(
new cricket::FakePortAllocator(rtc::Thread::Current(), nullptr)) {
BasicRegatheringController::Config regathering_config(absl::nullopt, 0);
BasicRegatheringController::Config regathering_config;
regathering_config.regather_on_failed_networks_interval = 0;
regathering_controller_.reset(new BasicRegatheringController(
regathering_config, ice_transport_.get(), rtc::Thread::Current()));
}
@ -121,15 +122,12 @@ TEST_F(RegatheringControllerTest,
rtc::ScopedFakeClock clock;
InitializeAndGatherOnce(); // Session not cleared.
rtc::IntervalRange regather_all_networks_interval_range(2000, 2000);
BasicRegatheringController::Config config(
regather_all_networks_interval_range, 2000);
BasicRegatheringController::Config config;
config.regather_on_failed_networks_interval = 2000;
regathering_controller()->SetConfig(config);
regathering_controller()->Start();
SIMULATED_WAIT(false, 10000, clock);
// Expect no regathering in the last 10s.
EXPECT_EQ(0, GetRegatheringReasonCount(
cricket::IceRegatheringReason::OCCASIONAL_REFRESH));
EXPECT_EQ(0, GetRegatheringReasonCount(
cricket::IceRegatheringReason::NETWORK_FAILURE));
}
@ -138,149 +136,25 @@ TEST_F(RegatheringControllerTest, IceRegatheringRepeatsAsScheduled) {
rtc::ScopedFakeClock clock;
InitializeAndGatherOnceWithSessionCleared();
rtc::IntervalRange regather_all_networks_interval_range(2000, 2000);
BasicRegatheringController::Config config(
regather_all_networks_interval_range, 2000);
BasicRegatheringController::Config config;
config.regather_on_failed_networks_interval = 2000;
regathering_controller()->SetConfig(config);
regathering_controller()->Start();
SIMULATED_WAIT(false, 2000 - 1, clock);
// Expect no regathering.
EXPECT_EQ(0, GetRegatheringReasonCount(
cricket::IceRegatheringReason::OCCASIONAL_REFRESH));
EXPECT_EQ(0, GetRegatheringReasonCount(
cricket::IceRegatheringReason::NETWORK_FAILURE));
SIMULATED_WAIT(false, 2, clock);
// Expect regathering on all networks and on failed networks to happen once
// respectively in that last 2s with 2s interval.
EXPECT_EQ(1, GetRegatheringReasonCount(
cricket::IceRegatheringReason::OCCASIONAL_REFRESH));
EXPECT_EQ(1, GetRegatheringReasonCount(
cricket::IceRegatheringReason::NETWORK_FAILURE));
SIMULATED_WAIT(false, 11000, clock);
// Expect regathering to happen for another 5 times in 11s with 2s interval.
EXPECT_EQ(6, GetRegatheringReasonCount(
cricket::IceRegatheringReason::OCCASIONAL_REFRESH));
EXPECT_EQ(6, GetRegatheringReasonCount(
cricket::IceRegatheringReason::NETWORK_FAILURE));
}
// Tests that the schedule of ICE regathering on all networks can be started
// when not scheduled initially.
TEST_F(RegatheringControllerTest,
IceRegatheringOnAllNetworksCanBeScheduledAfterStart) {
rtc::ScopedFakeClock clock;
InitializeAndGatherOnceWithSessionCleared();
BasicRegatheringController::Config config(absl::nullopt, 2000);
regathering_controller()->SetConfig(config);
regathering_controller()->Start();
SIMULATED_WAIT(false, 3000, clock);
// Expect no regathering on all networks.
EXPECT_EQ(0, GetRegatheringReasonCount(
cricket::IceRegatheringReason::OCCASIONAL_REFRESH));
config.regather_on_all_networks_interval_range =
rtc::IntervalRange(2000, 2000);
regathering_controller()->SetConfig(config);
SIMULATED_WAIT(false, 11000, clock);
// Expect regathering to happen for 5 times on all networks in the last 11s
// with 2s interval.
EXPECT_EQ(5, GetRegatheringReasonCount(
cricket::IceRegatheringReason::OCCASIONAL_REFRESH));
}
// Tests that ICE regathering on all networks can be canceled by changing the
// config.
TEST_F(RegatheringControllerTest, IceRegatheringOnAllNetworksCanBeCanceled) {
rtc::ScopedFakeClock clock;
InitializeAndGatherOnceWithSessionCleared();
rtc::IntervalRange regather_all_networks_interval_range(2000, 2000);
BasicRegatheringController::Config config(
regather_all_networks_interval_range, 2000);
regathering_controller()->SetConfig(config);
regathering_controller()->Start();
config.regather_on_all_networks_interval_range.reset();
// Set the regathering interval range on all networks to nullopt should cancel
// the schedule on all networks.
regathering_controller()->SetConfig(config);
SIMULATED_WAIT(false, 10000, clock);
// Expect no regathering on all networks happened in the last 10s.
EXPECT_EQ(0, GetRegatheringReasonCount(
cricket::IceRegatheringReason::OCCASIONAL_REFRESH));
}
// Tests that canceling the regathering on all networks does not cancel the
// schedule on failed networks.
TEST_F(RegatheringControllerTest,
CancelingRegatheringOnAllNetworksDoesNotCancelOnFailedNetworks) {
rtc::ScopedFakeClock clock;
InitializeAndGatherOnceWithSessionCleared();
rtc::IntervalRange regather_all_networks_interval_range(2000, 2000);
BasicRegatheringController::Config config(
regather_all_networks_interval_range, 2000);
regathering_controller()->SetConfig(config);
regathering_controller()->Start();
config.regather_on_all_networks_interval_range =
rtc::IntervalRange(20000, 20000);
// Canceling and rescheduling the regathering on all networks should not
// impact the schedule for failed networks.
regathering_controller()->SetConfig(config);
SIMULATED_WAIT(false, 11000, clock);
// Expect regathering to happen for 5 times for failed networks in the last
// 11s with 2s interval.
EXPECT_EQ(5, GetRegatheringReasonCount(
cricket::IceRegatheringReason::NETWORK_FAILURE));
}
// Tests that canceling the regathering on failed networks does not cancel the
// schedule on all networks.
TEST_F(RegatheringControllerTest,
CancelingRegatheringOnFailedNetworksDoesNotCancelOnAllNetworks) {
rtc::ScopedFakeClock clock;
InitializeAndGatherOnceWithSessionCleared();
rtc::IntervalRange regather_all_networks_interval_range(2000, 2000);
BasicRegatheringController::Config config(
regather_all_networks_interval_range, 2000);
regathering_controller()->SetConfig(config);
regathering_controller()->Start();
config.regather_on_failed_networks_interval = 20000;
// Canceling and rescheduling the regathering on failed networks should not
// impact the schedule for all networks.
regathering_controller()->SetConfig(config);
SIMULATED_WAIT(false, 11000, clock);
// Expect regathering to happen for 5 times for all networks in the last 11s
// with 2s interval.
EXPECT_EQ(5, GetRegatheringReasonCount(
cricket::IceRegatheringReason::OCCASIONAL_REFRESH));
}
// Tests that the schedule of ICE regathering on all networks can be canceled
// and replaced by a new recurring schedule.
TEST_F(RegatheringControllerTest,
ScheduleOfIceRegatheringOnAllNetworksCanBeReplaced) {
rtc::ScopedFakeClock clock;
InitializeAndGatherOnceWithSessionCleared();
rtc::IntervalRange regather_all_networks_interval_range(2000, 2000);
BasicRegatheringController::Config config(
regather_all_networks_interval_range, 2000);
regathering_controller()->SetConfig(config);
regathering_controller()->Start();
config.regather_on_all_networks_interval_range =
rtc::IntervalRange(5000, 5000);
regathering_controller()->SetConfig(config);
SIMULATED_WAIT(false, 3000, clock);
// Expect no regathering from the previous schedule.
EXPECT_EQ(0, GetRegatheringReasonCount(
cricket::IceRegatheringReason::OCCASIONAL_REFRESH));
SIMULATED_WAIT(false, 11000 - 3000, clock);
// Expect regathering to happen twice in the last 11s with 5s interval.
EXPECT_EQ(2, GetRegatheringReasonCount(
cricket::IceRegatheringReason::OCCASIONAL_REFRESH));
}
// Tests that the schedule of ICE regathering on failed networks can be canceled
// and replaced by a new recurring schedule.
TEST_F(RegatheringControllerTest,
@ -288,9 +162,8 @@ TEST_F(RegatheringControllerTest,
rtc::ScopedFakeClock clock;
InitializeAndGatherOnceWithSessionCleared();
rtc::IntervalRange regather_all_networks_interval_range(2000, 2000);
BasicRegatheringController::Config config(
regather_all_networks_interval_range, 2000);
BasicRegatheringController::Config config;
config.regather_on_failed_networks_interval = 2000;
regathering_controller()->SetConfig(config);
regathering_controller()->Start();
config.regather_on_failed_networks_interval = 5000;