Commit c32a3d1e authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

Deflake one of TouchActionBrowserTest

Some of the TouchActionBrowserTests are flaky. I was recently told by
sahel@ that setting speed_in_pixels_s to a very high number will ensure
there is one GSU only and will prevent the flaky. This does work, at
least locally. I have tried the test in this CL locally and it was
flaky without this change. With this change, I have ran this test 50
times without any failure.

This CL does that. Right now there are a few tests marked flaky, this
CL enables one of them first. I will monitor the flakiness dashboard
once this CL lands. If this does solve the problem, we will then enable
more tests.

Bug: 833015
Change-Id: I539703866094fb526e220c48aaf327836345b950
Reviewed-on: https://chromium-review.googlesource.com/1101464
Commit-Queue: Xida Chen <xidachen@chromium.org>
Reviewed-by: default avatarSahel Sharifymoghaddam <sahel@chromium.org>
Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567692}
parent 41027c95
......@@ -292,6 +292,12 @@ class TouchActionBrowserTest : public ContentBrowserTest {
params.gesture_source_type = SyntheticGestureParams::TOUCH_INPUT;
params.anchor = touch_point;
params.distances.push_back(-distance);
// Set the speed to very high so that there is one GSU only.
// It seems that when the speed is too high, it has a race with the timeout
// test.
if (jank_time != kLongJankTime) {
params.speed_in_pixels_s = 1000000;
}
run_loop_ = std::make_unique<base::RunLoop>();
......@@ -340,17 +346,9 @@ class TouchActionBrowserTest : public ContentBrowserTest {
int scroll_top = GetScrollTop();
int scroll_left = GetScrollLeft();
// It is hard to know when would the synthetic gesture being completely
// processed, so just make sure that it scrolled at least 1px along the
// expected scroll direction.
if (expected_scroll_position_after_scroll.y() > 0)
EXPECT_GT(scroll_top, 1);
else
EXPECT_EQ(scroll_top, 0);
if (expected_scroll_position_after_scroll.x() > 0)
EXPECT_GT(scroll_left, 1);
else
EXPECT_EQ(scroll_left, 0);
// Expect it scrolled at least half of the expected distance.
EXPECT_LE(expected_scroll_position_after_scroll.y() / 2, scroll_top);
EXPECT_LE(expected_scroll_position_after_scroll.x() / 2, scroll_left);
}
std::unique_ptr<RenderFrameSubmissionObserver> frame_observer_;
......@@ -477,7 +475,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest,
MAYBE_PanXYAtXAreaMainThreadJanky) {
LoadURL(kTouchActionURLWithOverlapArea);
DoTouchScroll(gfx::Point(125, 25), gfx::Vector2d(45, 45), false, 10000,
DoTouchScroll(gfx::Point(125, 25), gfx::Vector2d(45, 20), false, 10000,
gfx::Vector2d(45, 0), kShortJankTime);
}
......@@ -491,16 +489,15 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest,
MAYBE_PanXYAtYAreaMainThreadJanky) {
LoadURL(kTouchActionURLWithOverlapArea);
DoTouchScroll(gfx::Point(25, 125), gfx::Vector2d(45, 45), false, 10000,
DoTouchScroll(gfx::Point(25, 125), gfx::Vector2d(20, 45), false, 10000,
gfx::Vector2d(0, 45), kShortJankTime);
}
// Flaky on all platforms. http://crbug.com/851619
IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest,
DISABLED_PanXYAtAutoYOverlapAreaMainThreadJanky) {
PanXYAtAutoYOverlapAreaMainThreadJanky) {
LoadURL(kTouchActionURLWithOverlapArea);
DoTouchScroll(gfx::Point(75, 125), gfx::Vector2d(45, 45), false, 10000,
DoTouchScroll(gfx::Point(75, 125), gfx::Vector2d(20, 45), false, 10000,
gfx::Vector2d(0, 45), kShortJankTime);
}
......@@ -515,7 +512,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest,
MAYBE_PanXYAtAutoXOverlapAreaMainThreadJanky) {
LoadURL(kTouchActionURLWithOverlapArea);
DoTouchScroll(gfx::Point(125, 75), gfx::Vector2d(45, 45), false, 10000,
DoTouchScroll(gfx::Point(125, 75), gfx::Vector2d(45, 20), false, 10000,
gfx::Vector2d(45, 0), kShortJankTime);
}
......
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