Use newer version of TimeDelta and TimeStamp factories in webrtc
find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Micros<\(.*\)>()/TimeDelta::Micros(\1)/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Millis<\(.*\)>()/TimeDelta::Millis(\1)/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::Seconds<\(.*\)>()/TimeDelta::Seconds(\1)/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::us/TimeDelta::Micros/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::ms/TimeDelta::Millis/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/TimeDelta::seconds/TimeDelta::Seconds/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Micros<\(.*\)>()/Timestamp::Micros(\1)/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Millis<\(.*\)>()/Timestamp::Millis(\1)/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::Seconds<\(.*\)>()/Timestamp::Seconds(\1)/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::us/Timestamp::Micros/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::ms/Timestamp::Millis/g" find . -type f \( -name "*.h" -o -name "*.cc" \) | xargs sed -i -e "s/Timestamp::seconds/Timestamp::Seconds/g" git cl format Bug: None Change-Id: I87469d2e4a38369654da839ab7c838215a7911e7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168402 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30491}
This commit is contained in:
committed by
Commit Bot
parent
9b05803e19
commit
0c626afcf3
@ -29,7 +29,7 @@ using ::testing::Invoke;
|
||||
using ::testing::MockFunction;
|
||||
using ::testing::NiceMock;
|
||||
using ::testing::Return;
|
||||
constexpr Timestamp kStartTime = Timestamp::Seconds<1000>();
|
||||
constexpr Timestamp kStartTime = Timestamp::Seconds(1000);
|
||||
|
||||
class FakeAlarm : public ControlledAlarmClock {
|
||||
public:
|
||||
@ -82,8 +82,8 @@ void FakeAlarm::Sleep(TimeDelta duration) {
|
||||
} // namespace
|
||||
|
||||
TEST(ExternalTimeControllerTest, TaskIsStoppedOnStop) {
|
||||
const TimeDelta kShortInterval = TimeDelta::ms(5);
|
||||
const TimeDelta kLongInterval = TimeDelta::ms(20);
|
||||
const TimeDelta kShortInterval = TimeDelta::Millis(5);
|
||||
const TimeDelta kLongInterval = TimeDelta::Millis(20);
|
||||
const int kShortIntervalCount = 4;
|
||||
const int kMargin = 1;
|
||||
FakeAlarm alarm(kStartTime);
|
||||
@ -123,10 +123,10 @@ TEST(ExternalTimeControllerTest, TaskCanStopItself) {
|
||||
handle = RepeatingTaskHandle::Start(task_queue.Get(), [&] {
|
||||
++counter;
|
||||
handle.Stop();
|
||||
return TimeDelta::ms(2);
|
||||
return TimeDelta::Millis(2);
|
||||
});
|
||||
});
|
||||
time_simulation.AdvanceTime(TimeDelta::ms(10));
|
||||
time_simulation.AdvanceTime(TimeDelta::Millis(10));
|
||||
EXPECT_EQ(counter.load(), 1);
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ TEST(ExternalTimeControllerTest, TasksYieldToEachOther) {
|
||||
EXPECT_TRUE(event.Wait(200));
|
||||
});
|
||||
|
||||
time_simulation.AdvanceTime(TimeDelta::ms(300));
|
||||
time_simulation.AdvanceTime(TimeDelta::Millis(300));
|
||||
}
|
||||
|
||||
TEST(ExternalTimeControllerTest, CurrentTaskQueue) {
|
||||
@ -173,7 +173,7 @@ TEST(ExternalTimeControllerTest, CurrentTaskQueue) {
|
||||
|
||||
task_queue.PostTask([&] { EXPECT_TRUE(task_queue.IsCurrent()); });
|
||||
|
||||
time_simulation.AdvanceTime(TimeDelta::ms(10));
|
||||
time_simulation.AdvanceTime(TimeDelta::Millis(10));
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user