Commit 21a4e7fc authored by Ted Choc's avatar Ted Choc Committed by Commit Bot

Remove FlakyTest annotation from testBackKeyDoesNotDismissFindWhenImeIsPresent

Ran locally 50 times w/o flake.  This also cleans up the logging
and test prep to make it easier to detect systemic failures.

BUG=673930

Change-Id: I86349f9256ddc554c8de12d9dca80fc06458aa20
Reviewed-on: https://chromium-review.googlesource.com/1089649Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565314}
parent e1471a50
......@@ -34,7 +34,6 @@ import org.junit.runner.RunWith;
import org.chromium.base.ThreadUtils;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.FlakyTest;
import org.chromium.base.test.util.RetryOnFailure;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeSwitches;
......@@ -73,7 +72,7 @@ public class FindTest {
@After
public void tearDown() throws Exception {
mTestServer.stopAndDestroyServer();
if (mTestServer != null) mTestServer.stopAndDestroyServer();
}
/**
......@@ -424,7 +423,7 @@ public class FindTest {
@Test
@MediumTest
@Feature({"FindInPage"})
@FlakyTest(message = "https://crbug.com/673930")
@RetryOnFailure
public void testBackKeyDoesNotDismissFindWhenImeIsPresent() throws InterruptedException {
mActivityTestRule.loadUrl(mTestServer.getURL(FILEPATH));
findInPageFromMenu();
......@@ -461,13 +460,8 @@ public class FindTest {
private void waitForIME(final boolean imePresent) {
// Wait for IME to appear.
CriteriaHelper.pollUiThread(new Criteria("IME is not getting shown!") {
@Override
public boolean isSatisfied() {
return org.chromium.ui.UiUtils.isKeyboardShowing(
mActivityTestRule.getActivity(), getFindQueryText())
== imePresent;
}
});
CriteriaHelper.pollUiThread(Criteria.equals(imePresent,
() -> org.chromium.ui.UiUtils.isKeyboardShowing(
mActivityTestRule.getActivity(), getFindQueryText())));
}
}
......@@ -34,8 +34,10 @@ import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
import org.chromium.content.browser.test.util.TestTouchUtils;
import org.chromium.content.browser.test.util.TouchCommon;
import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.WebContents;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
......@@ -150,11 +152,13 @@ public class ChromeTabUtils {
"onPageLoadFinished was never called, but loading stopped "
+ "on the expected page. Tentatively continuing.");
} else {
Assert.fail("Page did not load. Tab information at time of failure --"
+ " url: " + url + ", final URL: " + tab.getUrl() + ", load progress: "
+ tab.getProgress() + ", is loading: " + Boolean.toString(tab.isLoading())
+ ", web contents loading: "
+ Boolean.toString(tab.getWebContents().isLoadingToDifferentDocument()));
WebContents webContents = tab.getWebContents();
Assert.fail(String.format(Locale.ENGLISH,
"Page did not load. Tab information at time of failure -- "
+ "expected url: '%s', actual URL: '%s', load progress: %d, is "
+ "loading: %b, web contents init: %b, web contents loading: %b",
url, tab.getUrl(), tab.getProgress(), tab.isLoading(), webContents != null,
webContents == null ? false : webContents.isLoadingToDifferentDocument()));
}
}
}
......
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