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

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

Issue 2096993002: MacViews: Fix failing mouse capture unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mouse_capture_lifetime
Patch Set: Rebase 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
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 a1ab5cb466b875c339e567b8e9b1ace56adc840d..55005ea2c4647103ab53c465a2105e3f0cd20934 100644
--- a/ui/views/test/event_generator_delegate_mac.mm
+++ b/ui/views/test/event_generator_delegate_mac.mm
@@ -428,7 +428,9 @@ gfx::Point EventGeneratorDelegateMac::CenterOfTarget(
gfx::Point EventGeneratorDelegateMac::CenterOfWindow(
gfx::NativeWindow window) const {
DCHECK_EQ(window, window_);
- return gfx::ScreenRectFromNSRect([window frame]).CenterPoint();
+ // Assume the window is at the top-left of the coordinate system (even if
+ // AppKit has moved it into the work area) see ConvertRootPointToTarget().
+ return gfx::Point(NSWidth([window frame]) / 2, NSHeight([window frame]) / 2);
}
// Return the current owner of the EventGeneratorDelegate. May be null.

Powered by Google App Engine
This is Rietveld 408576698