Commit 45755197 authored by Yue Zhang's avatar Yue Zhang Committed by Commit Bot

Bypass a flaky step in TabUiTestHelper#enterTabSwitcher

Some of the test flakiness in tab_ui are caused by tab switcher button
being invisible in NTP when we try to click it. This is likely due to
unexpected scrolling in NTP which hides the top tool bar. Before
landing the actual fix which could introduce some other flakiness,
this CL lands a workaround first to see how many flakiness could be
fixed by resolving this issue.

Bug: 1145271
Change-Id: Iae74425cdc66f41dbfc8eca0d91129c67e9bca05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2536385Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Commit-Queue: Yue Zhang <yuezhanggg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#830233}
parent ad14d083
...@@ -25,7 +25,6 @@ import static org.junit.Assert.assertTrue; ...@@ -25,7 +25,6 @@ import static org.junit.Assert.assertTrue;
import static org.chromium.base.test.util.CallbackHelper.WAIT_TIMEOUT_SECONDS; import static org.chromium.base.test.util.CallbackHelper.WAIT_TIMEOUT_SECONDS;
import static org.chromium.base.test.util.CriteriaHelper.DEFAULT_MAX_TIME_TO_POLL; import static org.chromium.base.test.util.CriteriaHelper.DEFAULT_MAX_TIME_TO_POLL;
import static org.chromium.base.test.util.CriteriaHelper.DEFAULT_POLLING_INTERVAL; import static org.chromium.base.test.util.CriteriaHelper.DEFAULT_POLLING_INTERVAL;
import static org.chromium.chrome.test.util.ViewUtils.onViewWaiting;
import static org.chromium.components.browser_ui.widget.RecyclerViewTestUtils.waitForStableRecyclerView; import static org.chromium.components.browser_ui.widget.RecyclerViewTestUtils.waitForStableRecyclerView;
import android.app.Activity; import android.app.Activity;
...@@ -100,7 +99,9 @@ public class TabUiTestHelper { ...@@ -100,7 +99,9 @@ public class TabUiTestHelper {
public static void enterTabSwitcher(ChromeTabbedActivity cta) { public static void enterTabSwitcher(ChromeTabbedActivity cta) {
OverviewModeBehaviorWatcher showWatcher = createOverviewShowWatcher(cta); OverviewModeBehaviorWatcher showWatcher = createOverviewShowWatcher(cta);
assertFalse(cta.getLayoutManager().overviewVisible()); assertFalse(cta.getLayoutManager().overviewVisible());
onViewWaiting(allOf(withId(R.id.tab_switcher_button), isDisplayed())).perform(click()); // TODO(crbug.com/1145271): Replace this with clicking tab switcher button via espresso.
TestThreadUtils.runOnUiThreadBlocking(
() -> { cta.findViewById(R.id.tab_switcher_button).performClick(); });
showWatcher.waitForBehavior(); showWatcher.waitForBehavior();
} }
......
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