Chromium Code Reviews| Index: ui/events/test/event_generator.h |
| diff --git a/ui/events/test/event_generator.h b/ui/events/test/event_generator.h |
| index f91143662e94f5e7867bc2a9c90438c4087e187c..ba2ec364187df7708de800cf6c0031fe74720dc4 100644 |
| --- a/ui/events/test/event_generator.h |
| +++ b/ui/events/test/event_generator.h |
| @@ -134,12 +134,22 @@ class EventGenerator { |
| void set_async(bool async) { async_ = async; } |
| bool async() const { return async_; } |
| - // Dispatch events through the application instead of directly to the |
| - // target window. Currently only supported on Mac. |
| - void set_targeting_application(bool targeting_application) { |
| - targeting_application_ = targeting_application; |
| - } |
| - bool targeting_application() const { return targeting_application_; } |
| + // Events could be dispatched using different methods. The choice is a |
| + // tradeoff between test robustness and coverage of OS internals that affect |
| + // event dispatch. |
| + // Currently only supported on Mac. |
| + enum class Target { |
| + // Dispatch through the application. Least robust. |
| + APPLICATION, |
| + // Dispatch directly to target window. |
| + WINDOW, |
| + // Default. Emulates default Window dispatch. Most robust. |
| + WIDGET, |
|
sadrul
2016/11/21 16:30:53
The difference between WINDOW and WIDGET isn't rea
themblsha
2016/11/21 17:02:20
Made the comments more verbose. "Currently only su
sadrul
2016/11/21 18:11:33
Whoops, I missed that comment :)
|
| + }; |
| + |
| + // Selects dispatch method. Currently only supported on Mac. |
| + void set_target(Target target) { target_ = target; } |
| + Target target() const { return target_; } |
| // Resets the event flags bitmask. |
| void set_flags(int flags) { flags_ = flags; } |
| @@ -410,7 +420,7 @@ class EventGenerator { |
| std::list<std::unique_ptr<Event>> pending_events_; |
| // Set to true to cause events to be posted asynchronously. |
| bool async_; |
| - bool targeting_application_; |
| + Target target_; |
| std::unique_ptr<base::TickClock> tick_clock_; |
| DISALLOW_COPY_AND_ASSIGN(EventGenerator); |