Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2654)

Unified Diff: base/test/simple_test_tick_clock.h

Issue 1132753008: Replaced TestNowSource with SimpleTestTickClock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing and additional code changes. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | base/test/simple_test_tick_clock.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/simple_test_tick_clock.h
diff --git a/base/test/simple_test_tick_clock.h b/base/test/simple_test_tick_clock.h
index aebdebcbcf54e7016a1629b5405eb40cbf22d801..07bbaf5ddfe9bf6d97060325927daa3c4d4ffc14 100644
--- a/base/test/simple_test_tick_clock.h
+++ b/base/test/simple_test_tick_clock.h
@@ -19,13 +19,21 @@ class SimpleTestTickClock : public TickClock {
public:
// Starts off with a clock set to TimeTicks().
SimpleTestTickClock();
+ SimpleTestTickClock(int64_t initial);
Paweł Hajdan Jr. 2015/05/26 11:30:25 Why are these additional ctors needed?
Ankur Verma 2015/05/26 12:58:29 These are convenience ctors really, for usage unde
+ SimpleTestTickClock(TimeTicks initial);
~SimpleTestTickClock() override;
TimeTicks NowTicks() override;
+ void Set(TimeTicks time);
Paweł Hajdan Jr. 2015/05/26 11:30:25 Why is Set needed?
Ankur Verma 2015/05/26 12:58:29 Again meant for convenient usage under cctests. Ca
// Advances the clock by |delta|, which must not be negative.
void Advance(TimeDelta delta);
+ // Convenience functions to make the now source easier to use in unit
Paweł Hajdan Jr. 2015/05/26 11:30:25 I don't see a reason enough for these convenience
Ankur Verma 2015/05/26 12:58:29 I understand SimpleTestTickClock must be as simple
+ // tests.
+ void AdvanceMicroseconds(int64_t period_in_microseconds);
+ void SetMicroseconds(int64_t time_in_microseconds);
+
private:
// Protects |now_ticks_|.
Lock lock_;
« no previous file with comments | « AUTHORS ('k') | base/test/simple_test_tick_clock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698