diff options
author | Sebastian Jansson <srte@webrtc.org> | 2018-05-08 14:52:22 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2018-05-08 13:22:53 +0000 |
commit | 5f83cf0c6d842352d8e017321f0223aefebb1bef (patch) | |
tree | 3a82358adf0e282e0c0de4c58ab85c22a0d1409e /common_audio | |
parent | 5b2b692079e65be33998e6b8e7e7b7efce3cf9bf (diff) | |
download | webrtc-5f83cf0c6d842352d8e017321f0223aefebb1bef.tar.gz |
Replacing rtc::TimeDelta with webrtc::TimeDelta.
This removes the redundant type and replaces all usages. A slight change
in behavior is that we no longer get nanosecond resolution. This should
not matter since no current code requires nanosecond resolution.
Bug: webrtc:9155
Change-Id: I04334e08c686d95731621a6c8a7e40400d0ae3b2
Reviewed-on: https://webrtc-review.googlesource.com/71163
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23174}
Diffstat (limited to 'common_audio')
-rw-r--r-- | common_audio/smoothing_filter_unittest.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/common_audio/smoothing_filter_unittest.cc b/common_audio/smoothing_filter_unittest.cc index d173c9ab85..abe4272a82 100644 --- a/common_audio/smoothing_filter_unittest.cc +++ b/common_audio/smoothing_filter_unittest.cc @@ -25,7 +25,7 @@ constexpr int64_t kClockInitialTime = 123456; struct SmoothingFilterStates { explicit SmoothingFilterStates(int init_time_ms) : smoothing_filter(init_time_ms) { - fake_clock.AdvanceTime(rtc::TimeDelta::FromMilliseconds(kClockInitialTime)); + fake_clock.AdvanceTime(TimeDelta::ms(kClockInitialTime)); } rtc::ScopedFakeClock fake_clock; SmoothingFilterImpl smoothing_filter; @@ -41,8 +41,7 @@ void CheckOutput(SmoothingFilterStates* states, int advance_time_ms, float expected_ouput) { states->smoothing_filter.AddSample(sample); - states->fake_clock.AdvanceTime( - rtc::TimeDelta::FromMilliseconds(advance_time_ms)); + states->fake_clock.AdvanceTime(TimeDelta::ms(advance_time_ms)); auto output = states->smoothing_filter.GetAverage(); EXPECT_TRUE(output); EXPECT_NEAR(expected_ouput, *output, kMaxAbsError); @@ -141,14 +140,13 @@ TEST(SmoothingFilterTest, CannotChangeTimeConstantDuringInitialization) { states.smoothing_filter.AddSample(0.0); // During initialization, |SetTimeConstantMs| does not take effect. - states.fake_clock.AdvanceTime( - rtc::TimeDelta::FromMilliseconds(kInitTimeMs - 1)); + states.fake_clock.AdvanceTime(TimeDelta::ms(kInitTimeMs - 1)); states.smoothing_filter.AddSample(0.0); EXPECT_FALSE(states.smoothing_filter.SetTimeConstantMs(kInitTimeMs * 2)); EXPECT_NE(exp(-1.0f / (kInitTimeMs * 2)), states.smoothing_filter.alpha()); - states.fake_clock.AdvanceTime(rtc::TimeDelta::FromMilliseconds(1)); + states.fake_clock.AdvanceTime(TimeDelta::ms(1)); states.smoothing_filter.AddSample(0.0); // When initialization finishes, the time constant should be come // |kInitTimeConstantMs|. |