Commit 24412ad6 authored by Bo Liu's avatar Bo Liu Committed by Commit Bot

weblayer: Disable TopControlsTest on L

Several attempts at de-flaking this test on the L bots did not help. The
flake cannot be reproduced locally using the same device and OS.

L coverage is not super important and the bot is not on CQ. So just
disable it on L.

This also reverts the last de-flake attempt:
https://chromium-review.googlesource.com/c/chromium/src/+/2063539

Bug: 1035894
Change-Id: I850b96360c08a0d7029729a4a08f7c51efa22b73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2068783Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743985}
parent b2543971
......@@ -4,6 +4,7 @@
package org.chromium.weblayer.test;
import android.os.Build;
import android.support.test.filters.SmallTest;
import android.support.v4.app.Fragment;
import android.view.View;
......@@ -16,6 +17,7 @@ import org.junit.runner.RunWith;
import org.chromium.base.test.util.CallbackHelper;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.MinAndroidSdkLevel;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.content_public.browser.test.util.Criteria;
import org.chromium.content_public.browser.test.util.CriteriaHelper;
......@@ -73,6 +75,8 @@ public class TopControlsTest {
helper.waitForCallback(0);
}
// Disabled on L bots due to unexplained flakes. See crbug.com/1035894.
@MinAndroidSdkLevel(Build.VERSION_CODES.M)
@Test
@SmallTest
public void testBasic() throws Exception {
......@@ -95,15 +99,16 @@ public class TopControlsTest {
mInitialVisiblePageHeight = getVisiblePageHeight();
Assert.assertTrue(mInitialVisiblePageHeight > 0);
// Move by the size of the top-controls.
EventUtils.simulateDragFromCenterOfView(
activity.getWindow().getDecorView(), 0, -mTopControlsHeight);
// Moving should change the size of the page. Don't attempt to correlate the size as the
// page doesn't see pixels, and to attempt to compare may result in rounding errors. Poll
// for this value as there is no good way to detect when done.
CriteriaHelper.pollInstrumentationThread(new Criteria() {
@Override
public boolean isSatisfied() {
// Move by the size of the top-controls.
EventUtils.simulateDragFromCenterOfView(
activity.getWindow().getDecorView(), 0, -mTopControlsHeight);
return mInitialVisiblePageHeight != getVisiblePageHeight();
}
});
......@@ -113,13 +118,14 @@ public class TopControlsTest {
Assert.assertEquals(View.INVISIBLE, activity.getTopContentsContainer().getVisibility());
});
// Move so top-controls are shown again.
EventUtils.simulateDragFromCenterOfView(
activity.getWindow().getDecorView(), 0, mTopControlsHeight);
// Wait for the page height to match initial height.
CriteriaHelper.pollInstrumentationThread(new Criteria() {
@Override
public boolean isSatisfied() {
// Move so top-controls are shown again.
EventUtils.simulateDragFromCenterOfView(
activity.getWindow().getDecorView(), 0, mTopControlsHeight);
return mInitialVisiblePageHeight == getVisiblePageHeight();
}
});
......
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