| Index: base/test/simple_test_tick_clock.cc
|
| diff --git a/base/test/simple_test_tick_clock.cc b/base/test/simple_test_tick_clock.cc
|
| index 1b4696fb592361e25562f2692089090beb50cf4e..e8ac00135d795812f7f768009d0037d5b96f64e3 100644
|
| --- a/base/test/simple_test_tick_clock.cc
|
| +++ b/base/test/simple_test_tick_clock.cc
|
| @@ -10,6 +10,14 @@ namespace base {
|
|
|
| SimpleTestTickClock::SimpleTestTickClock() {}
|
|
|
| +SimpleTestTickClock::SimpleTestTickClock(int64_t initial) : now_ticks_() {
|
| + now_ticks_ = TimeTicks::FromInternalValue(initial);
|
| +}
|
| +
|
| +SimpleTestTickClock::SimpleTestTickClock(TimeTicks initial) : now_ticks_() {
|
| + now_ticks_ = initial;
|
| +}
|
| +
|
| SimpleTestTickClock::~SimpleTestTickClock() {}
|
|
|
| TimeTicks SimpleTestTickClock::NowTicks() {
|
| @@ -17,10 +25,25 @@ TimeTicks SimpleTestTickClock::NowTicks() {
|
| return now_ticks_;
|
| }
|
|
|
| +void SimpleTestTickClock::Set(TimeTicks time) {
|
| + AutoLock lock(lock_);
|
| + DCHECK(time >= now_ticks_); // Time should always go forward.
|
| + now_ticks_ = time;
|
| +}
|
| +
|
| void SimpleTestTickClock::Advance(TimeDelta delta) {
|
| AutoLock lock(lock_);
|
| DCHECK(delta >= TimeDelta());
|
| now_ticks_ += delta;
|
| }
|
|
|
| +// SimpleTestTickClock::Convenience functions
|
| +void SimpleTestTickClock::AdvanceMicroseconds(int64_t period_in_microseconds) {
|
| + Advance(TimeDelta::FromMicroseconds(period_in_microseconds));
|
| +}
|
| +
|
| +void SimpleTestTickClock::SetMicroseconds(int64_t time_in_microseconds) {
|
| + Set(TimeTicks::FromInternalValue(time_in_microseconds));
|
| +}
|
| +
|
| } // namespace base
|
|
|