Deflake ui_controls::SendMouseMove on Windows.
On Windows, SendMouseMove must transform a point in screen coordinates into the range (0..2^16-1) for consumption by SendInput. Windows then converts this back to screen coordinates. This change rounds up rather than down in the initial conversion so that Windows lands on the correct point when it seemly truncates. Previously, we'd see off-by-one errors from time to time. While this may seem insignificant at first blush, it's problematic when SendMouseMove is called to move the mouse to a point where it already resides. No events are generated by SendInput in this case, so the hook proc will never be called. This shouldn't be a problem since SendMouseMove detects this case and short-circuits the request. With the ob1, however, SendMouseMove thinks it needs to move the mouse by one point, yet the bad math results in a call to SendInput to move the mouse to its current position. This makes tests timeout and all of us sad. BUG=390564,639940,710436,726659,728488,764415 R=mathp@chromium.org, sky@chromium.org Change-Id: I1daebe8281db0a799ef7266c3c1765de65580f03 Reviewed-on: https://chromium-review.googlesource.com/686898Reviewed-by:Scott Violet <sky@chromium.org> Reviewed-by:
Mathieu Perreault <mathp@chromium.org> Commit-Queue: Greg Thompson <grt@chromium.org> Cr-Commit-Position: refs/heads/master@{#506574}
Showing
Please register or sign in to comment