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

Unified Diff: ui/views/test/event_generator_delegate_mac.mm

Issue 2053253002: Support a ui::test::EventGenerator constructed with a single argument on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update EventGenerator comment Created 4 years, 6 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 | « ui/events/test/event_generator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/event_generator_delegate_mac.mm
diff --git a/ui/views/test/event_generator_delegate_mac.mm b/ui/views/test/event_generator_delegate_mac.mm
index a005dbca212fa68b147096c127affe3ae6a50e66..a1ab5cb466b875c339e567b8e9b1ace56adc840d 100644
--- a/ui/views/test/event_generator_delegate_mac.mm
+++ b/ui/views/test/event_generator_delegate_mac.mm
@@ -382,6 +382,11 @@ void EventGeneratorDelegateMac::OnTouchEvent(ui::TouchEvent* event) {
void EventGeneratorDelegateMac::SetContext(ui::test::EventGenerator* owner,
gfx::NativeWindow root_window,
gfx::NativeWindow window) {
+ // Mac doesn't use a |root_window|. Assume that if a single-argument
+ // constructor was used, it should be the actual |window|.
+ if (!window)
+ window = root_window;
+
swizzle_pressed_.reset();
swizzle_location_.reset();
swizzle_current_event_.reset();
« no previous file with comments | « ui/events/test/event_generator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698