Commit 46ba2041 authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

Fix OverviewSessionFlingTest.BasicFling flakiness

The test has started failing on official builds after CL:2333141. That
change prevents home button bounds animations that would not actually
change the button's bounds. It looks like removed compositing requests
(caused by setting identical button bounds/transform) caused
OverviewSessionFlingTest.BasicFling to end before sufficient number of
grid fling animation steps get handled.
This updates the test to wait for compositing to start during each test
iteration (as animation steps depend on compositing).

BUG=None

Change-Id: I0ed5946be12300e8e450d2796acf7e7318f8c914
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2333742
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Reviewed-by: default avatarSammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794265}
parent 95955e3a
...@@ -3500,8 +3500,9 @@ TEST_F(OverviewSessionFlingTest, BasicFling) { ...@@ -3500,8 +3500,9 @@ TEST_F(OverviewSessionFlingTest, BasicFling) {
item_center, item_center + shift, base::TimeDelta::FromMilliseconds(10), item_center, item_center + shift, base::TimeDelta::FromMilliseconds(10),
10); 10);
ui::DrawWaiterForTest::WaitForCompositingStarted( ui::Compositor* const compositor =
windows[0]->GetRootWindow()->layer()->GetCompositor()); windows[0]->GetRootWindow()->layer()->GetCompositor();
ui::DrawWaiterForTest::WaitForCompositingStarted(compositor);
ASSERT_TRUE(grid_event_handler->IsFlingInProgressForTesting()); ASSERT_TRUE(grid_event_handler->IsFlingInProgressForTesting());
// Test that the scroll offset decreases as we advance the clock. Check the // Test that the scroll offset decreases as we advance the clock. Check the
...@@ -3516,6 +3517,7 @@ TEST_F(OverviewSessionFlingTest, BasicFling) { ...@@ -3516,6 +3517,7 @@ TEST_F(OverviewSessionFlingTest, BasicFling) {
i < kMaxLoops && grid_event_handler->IsFlingInProgressForTesting(); i < kMaxLoops && grid_event_handler->IsFlingInProgressForTesting();
++i) { ++i) {
task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(50)); task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(50));
ui::DrawWaiterForTest::WaitForCompositingStarted(compositor);
float scroll_offset = grid->scroll_offset(); float scroll_offset = grid->scroll_offset();
EXPECT_LE(scroll_offset, previous_scroll_offset); EXPECT_LE(scroll_offset, previous_scroll_offset);
......
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