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