Index: chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupWithKeyboardTest.java |
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupWithKeyboardTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupWithKeyboardTest.java |
index 448aa1cceb4c8ae9f236305a0dc48ccd7dead931..3d29ccf87e019293ebb7d2089e6d049c53927b0d 100644 |
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupWithKeyboardTest.java |
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupWithKeyboardTest.java |
@@ -7,21 +7,13 @@ |
import android.support.test.filters.MediumTest; |
import android.view.ViewGroup; |
-import org.junit.Assert; |
-import org.junit.Rule; |
-import org.junit.Test; |
-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.RetryOnFailure; |
import org.chromium.base.test.util.UrlUtils; |
import org.chromium.chrome.browser.ChromeActivity; |
-import org.chromium.chrome.browser.ChromeSwitches; |
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; |
-import org.chromium.chrome.test.ChromeActivityTestRule; |
-import org.chromium.chrome.test.ChromeJUnit4ClassRunner; |
+import org.chromium.chrome.test.ChromeActivityTestCaseBase; |
import org.chromium.components.autofill.AutofillPopup; |
import org.chromium.content.browser.ContentViewCore; |
import org.chromium.content.browser.test.util.Criteria; |
@@ -39,24 +31,26 @@ |
/** |
* Integration tests for interaction of the AutofillPopup and a keyboard. |
*/ |
-@RunWith(ChromeJUnit4ClassRunner.class) |
-@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE, |
- ChromeActivityTestRule.DISABLE_NETWORK_PREDICTION_FLAG}) |
-public class AutofillPopupWithKeyboardTest { |
- @Rule |
- public ChromeActivityTestRule<ChromeActivity> mActivityTestRule = |
- new ChromeActivityTestRule<>(ChromeActivity.class); |
+public class AutofillPopupWithKeyboardTest extends ChromeActivityTestCaseBase<ChromeActivity> { |
+ |
+ public AutofillPopupWithKeyboardTest() { |
+ super(ChromeActivity.class); |
+ } |
+ |
+ @Override |
+ public void startMainActivity() throws InterruptedException { |
+ // Don't launch activity automatically. |
+ } |
/** |
* Test that showing autofill popup and keyboard will not hide the autofill popup. |
*/ |
- @Test |
@MediumTest |
@Feature({"autofill-keyboard"}) |
@RetryOnFailure |
public void testShowAutofillPopupAndKeyboardimultaneously() |
throws InterruptedException, ExecutionException, TimeoutException { |
- mActivityTestRule.startMainActivityWithURL(UrlUtils.encodeHtmlDataUri("<html><head>" |
+ startMainActivityWithURL(UrlUtils.encodeHtmlDataUri("<html><head>" |
+ "<meta name=\"viewport\"" |
+ "content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0\" /></head>" |
+ "<body><form method=\"POST\">" |
@@ -85,7 +79,7 @@ |
ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
@Override |
public void run() { |
- viewCoreRef.set(mActivityTestRule.getActivity().getCurrentContentViewCore()); |
+ viewCoreRef.set(getActivity().getCurrentContentViewCore()); |
webContentsRef.set(viewCoreRef.get().getWebContents()); |
viewRef.set(viewCoreRef.get().getContainerView()); |
} |
@@ -101,10 +95,9 @@ |
CriteriaHelper.pollUiThread(new Criteria("Keyboard was never shown.") { |
@Override |
public boolean isSatisfied() { |
- return UiUtils.isKeyboardShowing(mActivityTestRule.getActivity(), |
- mActivityTestRule.getActivity() |
- .getCurrentContentViewCore() |
- .getContainerView()); |
+ return UiUtils.isKeyboardShowing( |
+ getActivity(), |
+ getActivity().getCurrentContentViewCore().getContainerView()); |
} |
}); |
@@ -122,7 +115,7 @@ |
return viewRef.get().findViewById(R.id.dropdown_popup_window).getTag(); |
} |
}); |
- Assert.assertTrue(popupObject instanceof AutofillPopup); |
+ assertTrue(popupObject instanceof AutofillPopup); |
final AutofillPopup popup = (AutofillPopup) popupObject; |
CriteriaHelper.pollUiThread(new Criteria("Autofill Popup was never shown.") { |
@Override |