Add AddPhasedLoop to support phased loops
This lets us convert phased loops over nicely in various places.
Change-Id: Icdde4520f991fc541fbbe7ab3d9b945bb8c12e83
diff --git a/aos/events/event-loop_param_test.h b/aos/events/event-loop_param_test.h
index 1d2060a..26d869d 100644
--- a/aos/events/event-loop_param_test.h
+++ b/aos/events/event-loop_param_test.h
@@ -21,6 +21,9 @@
// Runs the loops until they quit.
virtual void Run() = 0;
+
+ // Advances time by sleeping. Can't be called from inside a loop.
+ virtual void SleepFor(::std::chrono::nanoseconds duration) = 0;
};
class AbstractEventLoopTestBase
@@ -32,6 +35,10 @@
::std::unique_ptr<EventLoop> MakePrimary() { return factory_->MakePrimary(); }
void Run() { return factory_->Run(); }
+
+ void SleepFor(::std::chrono::nanoseconds duration) {
+ return factory_->SleepFor(duration);
+ }
// You can implement all the usual fixture class members here.
// To access the test parameter, call GetParam() from class
// TestWithParam<T>.