| Index: ui/events/test/event_generator.h
|
| diff --git a/ui/events/test/event_generator.h b/ui/events/test/event_generator.h
|
| index 51268390a42ba1637d3bae85982daa1b656e0e9e..435f72afcc4d03213d5dbccfa001ad5d86d9c6c7 100644
|
| --- a/ui/events/test/event_generator.h
|
| +++ b/ui/events/test/event_generator.h
|
| @@ -159,6 +159,20 @@ class EventGenerator {
|
| void set_flags(int flags) { flags_ = flags; }
|
| int flags() const { return flags_; }
|
|
|
| + // Many tests assume a window created at (0,0) will remain there when shown.
|
| + // However, an operating system's window manager may reposition the window
|
| + // into the work area. This can disrupt the coordinates used on test events,
|
| + // so an EventGeneratorDelegate may skip the step that remaps coordinates in
|
| + // the root window to window coordinates when dispatching events.
|
| + // Setting this to false skips that step, in which case the test must ensure
|
| + // it correctly maps coordinates in window coordinates to root window (screen)
|
| + // coordinates when calling, e.g., set_current_location().
|
| + // Default is true.
|
| + void set_assume_window_at_origin(bool assume_window_at_origin) {
|
| + assume_window_at_origin_ = assume_window_at_origin;
|
| + }
|
| + bool assume_window_at_origin() { return assume_window_at_origin_; }
|
| +
|
| // Generates a left button press event.
|
| void PressLeftButton();
|
|
|
| @@ -446,15 +460,23 @@ class EventGenerator {
|
|
|
| std::unique_ptr<EventGeneratorDelegate> delegate_;
|
| gfx::Point current_location_;
|
| - EventTarget* current_target_;
|
| - int flags_;
|
| - bool grab_;
|
| + EventTarget* current_target_ = nullptr;
|
| + int flags_ = 0;
|
| + bool grab_ = false;
|
| +
|
| ui::PointerDetails touch_pointer_details_;
|
|
|
| std::list<std::unique_ptr<Event>> pending_events_;
|
| +
|
| // Set to true to cause events to be posted asynchronously.
|
| - bool async_;
|
| - Target target_;
|
| + bool async_ = false;
|
| +
|
| + // Whether to skip mapping of coordinates from the root window to a hit window
|
| + // when dispatching events.
|
| + bool assume_window_at_origin_ = true;
|
| +
|
| + Target target_ = Target::WIDGET;
|
| +
|
| std::unique_ptr<base::TickClock> tick_clock_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(EventGenerator);
|
|
|