Use newer version of TimeDelta and TimeStamp factories in modules/

This change generated with following commands:
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Micros<\(.*\)>()/TimeDelta::Micros(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Millis<\(.*\)>()/TimeDelta::Millis(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Seconds<\(.*\)>()/TimeDelta::Seconds(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::us/TimeDelta::Micros/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::ms/TimeDelta::Millis/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::seconds/TimeDelta::Seconds/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Micros<\(.*\)>()/Timestamp::Micros(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Millis<\(.*\)>()/Timestamp::Millis(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Seconds<\(.*\)>()/Timestamp::Seconds(\1)/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::us/Timestamp::Micros/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::ms/Timestamp::Millis/g"
find modules -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::seconds/Timestamp::Seconds/g"
git cl format

Bug: None
Change-Id: I117d64a54950be040d996035c54bc0043310943a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168340
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30489}
This commit is contained in:
Danil Chapovalov
2020-02-07 14:53:52 +01:00
committed by Commit Bot
parent 2fe31a47b6
commit 5528402ef8
71 changed files with 517 additions and 498 deletions

View File

@ -178,7 +178,7 @@ TEST(AudioNetworkAdaptorImplTest,
"WebRTC-Audio-BitrateAdaptation/Enabled/WebRTC-Audio-FecAdaptation/"
"Enabled/");
rtc::ScopedFakeClock fake_clock;
fake_clock.AdvanceTime(TimeDelta::ms(kClockInitialTimeMs));
fake_clock.AdvanceTime(TimeDelta::Millis(kClockInitialTimeMs));
auto states = CreateAudioNetworkAdaptor();
AudioEncoderRuntimeConfig config;
config.bitrate_bps = 32000;
@ -196,7 +196,7 @@ TEST(AudioNetworkAdaptorImplTest,
TEST(AudioNetworkAdaptorImplTest,
DumpNetworkMetricsIsCalledOnSetNetworkMetrics) {
rtc::ScopedFakeClock fake_clock;
fake_clock.AdvanceTime(TimeDelta::ms(kClockInitialTimeMs));
fake_clock.AdvanceTime(TimeDelta::Millis(kClockInitialTimeMs));
auto states = CreateAudioNetworkAdaptor();
@ -214,31 +214,31 @@ TEST(AudioNetworkAdaptorImplTest,
DumpNetworkMetrics(NetworkMetricsIs(check), timestamp_check));
states.audio_network_adaptor->SetUplinkBandwidth(kBandwidth);
fake_clock.AdvanceTime(TimeDelta::ms(100));
fake_clock.AdvanceTime(TimeDelta::Millis(100));
timestamp_check += 100;
check.uplink_packet_loss_fraction = kPacketLoss;
EXPECT_CALL(*states.mock_debug_dump_writer,
DumpNetworkMetrics(NetworkMetricsIs(check), timestamp_check));
states.audio_network_adaptor->SetUplinkPacketLossFraction(kPacketLoss);
fake_clock.AdvanceTime(TimeDelta::ms(50));
fake_clock.AdvanceTime(TimeDelta::Millis(50));
timestamp_check += 50;
fake_clock.AdvanceTime(TimeDelta::ms(200));
fake_clock.AdvanceTime(TimeDelta::Millis(200));
timestamp_check += 200;
check.rtt_ms = kRtt;
EXPECT_CALL(*states.mock_debug_dump_writer,
DumpNetworkMetrics(NetworkMetricsIs(check), timestamp_check));
states.audio_network_adaptor->SetRtt(kRtt);
fake_clock.AdvanceTime(TimeDelta::ms(150));
fake_clock.AdvanceTime(TimeDelta::Millis(150));
timestamp_check += 150;
check.target_audio_bitrate_bps = kTargetAudioBitrate;
EXPECT_CALL(*states.mock_debug_dump_writer,
DumpNetworkMetrics(NetworkMetricsIs(check), timestamp_check));
states.audio_network_adaptor->SetTargetAudioBitrate(kTargetAudioBitrate);
fake_clock.AdvanceTime(TimeDelta::ms(50));
fake_clock.AdvanceTime(TimeDelta::Millis(50));
timestamp_check += 50;
check.overhead_bytes_per_packet = kOverhead;
EXPECT_CALL(*states.mock_debug_dump_writer,

View File

@ -147,7 +147,7 @@ TEST(ControllerManagerTest, DoNotReorderBeforeMinReordingTime) {
CheckControllersOrder(&states, kChracteristicBandwithBps[0],
kChracteristicPacketLossFraction[0],
{kNumControllers - 2, kNumControllers - 1, 0, 1});
fake_clock.AdvanceTime(TimeDelta::ms(kMinReorderingTimeMs - 1));
fake_clock.AdvanceTime(TimeDelta::Millis(kMinReorderingTimeMs - 1));
// Move uplink bandwidth and packet loss fraction to the other controller's
// characteristic point, which would cause controller manager to reorder the
// controllers if time had reached min reordering time.
@ -168,7 +168,7 @@ TEST(ControllerManagerTest, ReorderBeyondMinReordingTimeAndMinDistance) {
// of two controllers.
CheckControllersOrder(&states, kBandwidthBps, kPacketLossFraction,
{kNumControllers - 2, kNumControllers - 1, 0, 1});
fake_clock.AdvanceTime(TimeDelta::ms(kMinReorderingTimeMs));
fake_clock.AdvanceTime(TimeDelta::Millis(kMinReorderingTimeMs));
// Then let network metrics move a little towards the other controller.
CheckControllersOrder(&states, kBandwidthBps - kMinBandwithChangeBps - 1,
kPacketLossFraction,
@ -187,7 +187,7 @@ TEST(ControllerManagerTest, DoNotReorderIfNetworkMetricsChangeTooSmall) {
// of two controllers.
CheckControllersOrder(&states, kBandwidthBps, kPacketLossFraction,
{kNumControllers - 2, kNumControllers - 1, 0, 1});
fake_clock.AdvanceTime(TimeDelta::ms(kMinReorderingTimeMs));
fake_clock.AdvanceTime(TimeDelta::Millis(kMinReorderingTimeMs));
// Then let network metrics move a little towards the other controller.
CheckControllersOrder(&states, kBandwidthBps - kMinBandwithChangeBps + 1,
kPacketLossFraction,
@ -349,7 +349,7 @@ TEST(ControllerManagerTest, DebugDumpLoggedWhenCreateFromConfigString) {
constexpr int64_t kClockInitialTimeMs = 12345678;
rtc::ScopedFakeClock fake_clock;
fake_clock.AdvanceTime(TimeDelta::ms(kClockInitialTimeMs));
fake_clock.AdvanceTime(TimeDelta::Millis(kClockInitialTimeMs));
auto debug_dump_writer =
std::unique_ptr<MockDebugDumpWriter>(new NiceMock<MockDebugDumpWriter>());
EXPECT_CALL(*debug_dump_writer, Die());
@ -446,7 +446,7 @@ TEST(ControllerManagerTest, CreateFromConfigStringAndCheckReordering) {
metrics.uplink_bandwidth_bps = kChracteristicBandwithBps[1];
metrics.uplink_packet_loss_fraction = kChracteristicPacketLossFraction[1];
fake_clock.AdvanceTime(TimeDelta::ms(kMinReorderingTimeMs - 1));
fake_clock.AdvanceTime(TimeDelta::Millis(kMinReorderingTimeMs - 1));
controllers = states.controller_manager->GetSortedControllers(metrics);
// Should not reorder since min reordering time is not met.
CheckControllersOrder(controllers,
@ -455,7 +455,7 @@ TEST(ControllerManagerTest, CreateFromConfigStringAndCheckReordering) {
ControllerType::CHANNEL, ControllerType::DTX,
ControllerType::BIT_RATE});
fake_clock.AdvanceTime(TimeDelta::ms(1));
fake_clock.AdvanceTime(TimeDelta::Millis(1));
controllers = states.controller_manager->GetSortedControllers(metrics);
// Reorder now.
CheckControllersOrder(controllers,