Index: ui/aura/test/event_generator.h |
diff --git a/ui/aura/test/event_generator.h b/ui/aura/test/event_generator.h |
index 29832b14f11aabd48f7e7cb508831996c4ddc317..4791593ab75b01c442894563b8375504d1ee8daa 100644 |
--- a/ui/aura/test/event_generator.h |
+++ b/ui/aura/test/event_generator.h |
@@ -11,14 +11,11 @@ |
#include "base/basictypes.h" |
#include "base/callback.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/time/time.h" |
#include "ui/events/event_constants.h" |
#include "ui/events/keycodes/keyboard_codes.h" |
#include "ui/gfx/point.h" |
-namespace base { |
-class TimeDelta; |
-} |
- |
namespace ui { |
class Event; |
class EventProcessor; |
@@ -317,6 +314,18 @@ class EventGenerator { |
current_host_ = host; |
} |
+ // If this is called, simulated time will be used as the time for all |
+ // events, rather than the current time. |
+ void UseSimulatedTime(); |
sky
2014/06/06 16:35:25
Instead of UseSimulateTime/Advance... how about a
|
+ |
+ // If UseSimulatedTime has been called, advance the simulated time by |
+ // the given delta. |
+ void AdvanceSimulatedTimeBy(base::TimeDelta delta); |
+ |
+ // Return the current time - if UseSimulatedTime was called, it will return |
+ // the current simulated time, otherwise the real wall-clock time. |
+ base::TimeDelta Now(); |
+ |
private: |
// Dispatch a key event to the WindowEventDispatcher. |
void DispatchKeyEvent(bool is_press, ui::KeyboardCode key_code, int flags); |
@@ -346,6 +355,8 @@ class EventGenerator { |
std::list<ui::Event*> pending_events_; |
// Set to true to cause events to be posted asynchronously. |
bool async_; |
+ bool use_simulated_time_; |
+ base::TimeDelta simulated_time_; |
DISALLOW_COPY_AND_ASSIGN(EventGenerator); |
}; |