Commit 80c967c4 authored by Matthew Jones's avatar Matthew Jones Committed by Commit Bot

Attempt to deflake testTabSwitcherPortraitCloseButton

This patch removes the use of OverviewModeBehaviorWatcher which is
completely unnecessary for testing the close button. Instead, we now
just force the tab switcher open without animation. This is the most
persistent (if not the only) source of failure for this test.

Bug: 838719
Change-Id: I327347973890f8c10a332a82825a89504bc8c31e
Reviewed-on: https://chromium-review.googlesource.com/1045092
Commit-Queue: Matthew Jones <mdjones@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556461}
parent 90e9fb17
...@@ -522,14 +522,11 @@ public class TabsTest { ...@@ -522,14 +522,11 @@ public class TabsTest {
mActivityTestRule.getActivity(); mActivityTestRule.getActivity();
int initialTabCount = mActivityTestRule.getActivity().getCurrentTabModel().getCount(); int initialTabCount = mActivityTestRule.getActivity().getCurrentTabModel().getCount();
ChromeTabUtils.newTabFromMenu( ChromeTabUtils.fullyLoadUrlInNewTab(InstrumentationRegistry.getInstrumentation(),
InstrumentationRegistry.getInstrumentation(), mActivityTestRule.getActivity()); mActivityTestRule.getActivity(), ContentUrlConstants.ABOUT_BLANK_URL, false);
InstrumentationRegistry.getInstrumentation().waitForIdleSync(); ThreadUtils.runOnUiThreadBlocking(
View button = mActivityTestRule.getActivity().findViewById(R.id.tab_switcher_button); () -> { mActivityTestRule.getActivity().getLayoutManager().showOverview(false); });
OverviewModeBehaviorWatcher overviewModeWatcher = new OverviewModeBehaviorWatcher(
mActivityTestRule.getActivity().getLayoutManager(), true, false);
TouchCommon.singleClickView(button);
overviewModeWatcher.waitForBehavior();
Assert.assertTrue("Expected: " + (initialTabCount + 1) + " tab Got: " Assert.assertTrue("Expected: " + (initialTabCount + 1) + " tab Got: "
+ mActivityTestRule.getActivity().getCurrentTabModel().getCount(), + mActivityTestRule.getActivity().getCurrentTabModel().getCount(),
(initialTabCount + 1) (initialTabCount + 1)
......
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