Commit 2b958d13 authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

Fix HotseatWidgetTest.InAppToHomeChangesStateOnce flakiness

The test tries to tap the home button (using GetBoundsInScreen to get
the button location), but misses it in some cases (because it gets
coordinates that are outside the screen bounds).

This started flaking out when the navingation buttons bounds
animator was switched to use transforms instead of bounds - CL:2086257 -
when setting home button bounds without animation, ShelfNavigationWidget
would just set the new button bounds rect, without stopping any in
progress bounds animation. This works well if only bounds are animated,
but it doesn't stop the transform animation. So if the bounds are set
directly, the transform would keep animating, but transform would be
calculated relative to the actual target bounds.

BUG=1058514

Change-Id: Ib53f40bcb828ce4fce01364e02c48b8c28586b92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090460Reviewed-by: default avatarManu Cornet <manucornet@chromium.org>
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747442}
parent 5add4705
...@@ -624,6 +624,7 @@ void ShelfNavigationWidget::UpdateLayout(bool animate) { ...@@ -624,6 +624,7 @@ void ShelfNavigationWidget::UpdateLayout(bool animate) {
home_button_metrics_reporter_.get()); home_button_metrics_reporter_.get());
bounds_animator_->AnimateViewTo(home_button, home_button_bounds); bounds_animator_->AnimateViewTo(home_button, home_button_bounds);
} else { } else {
bounds_animator_->StopAnimatingView(home_button);
home_button->SetBoundsRect(home_button_bounds); home_button->SetBoundsRect(home_button_bounds);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment