| Index: chrome/android/javatests_shell/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_shell/src/org/chromium/chrome/browser/autofill/AutofillPopupWithKeyboardTest.java
|
| similarity index 89%
|
| rename from chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupWithKeyboardTest.java
|
| rename to chrome/android/javatests_shell/src/org/chromium/chrome/browser/autofill/AutofillPopupWithKeyboardTest.java
|
| index b119d04401e67cc9590503eddf5692b7efed0163..e023517f4b2e5c89febfa70bd6c4be2167c9857a 100644
|
| --- a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillPopupWithKeyboardTest.java
|
| +++ b/chrome/android/javatests_shell/src/org/chromium/chrome/browser/autofill/AutofillPopupWithKeyboardTest.java
|
| @@ -11,9 +11,8 @@ import org.chromium.base.ThreadUtils;
|
| import org.chromium.base.test.util.Feature;
|
| import org.chromium.base.test.util.UrlUtils;
|
| import org.chromium.chrome.R;
|
| -import org.chromium.chrome.browser.ChromeActivity;
|
| import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
|
| -import org.chromium.chrome.test.ChromeActivityTestCaseBase;
|
| +import org.chromium.chrome.shell.ChromeShellTestBase;
|
| import org.chromium.content.browser.ContentViewCore;
|
| import org.chromium.content.browser.test.util.Criteria;
|
| import org.chromium.content.browser.test.util.CriteriaHelper;
|
| @@ -30,17 +29,7 @@ import java.util.concurrent.atomic.AtomicReference;
|
| /**
|
| * Integration tests for interaction of the AutofillPopup and a keyboard.
|
| */
|
| -public class AutofillPopupWithKeyboardTest extends ChromeActivityTestCaseBase<ChromeActivity> {
|
| -
|
| - public AutofillPopupWithKeyboardTest() {
|
| - super(ChromeActivity.class);
|
| - }
|
| -
|
| - @Override
|
| - public void startMainActivity() throws InterruptedException {
|
| - // Don't launch activity automatically.
|
| - }
|
| -
|
| +public class AutofillPopupWithKeyboardTest extends ChromeShellTestBase {
|
| /**
|
| * Test that showing autofill popup and keyboard will not hide the autofill popup.
|
| */
|
| @@ -48,7 +37,7 @@ public class AutofillPopupWithKeyboardTest extends ChromeActivityTestCaseBase<Ch
|
| @Feature({"autofill-keyboard"})
|
| public void testShowAutofillPopupAndKeyboardimultaneously()
|
| throws InterruptedException, ExecutionException, TimeoutException {
|
| - startMainActivityWithURL(UrlUtils.encodeHtmlDataUri("<html><head>"
|
| + launchChromeShellWithUrl(UrlUtils.encodeHtmlDataUri("<html><head>"
|
| + "<meta name=\"viewport\""
|
| + "content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0\" /></head>"
|
| + "<body><form method=\"POST\">"
|
| @@ -68,6 +57,7 @@ public class AutofillPopupWithKeyboardTest extends ChromeActivityTestCaseBase<Ch
|
| + "</select>"
|
| + "<input type=\"submit\" />"
|
| + "</form></body></html>"));
|
| + assertTrue(waitForActiveShellToBeDoneLoading());
|
| new AutofillTestHelper().setProfile(new AutofillProfile("", "https://www.example.com",
|
| "John Smith", "Acme Inc", "1 Main\nApt A", "CA", "San Francisco", "", "94102", "",
|
| "US", "(415) 888-9999", "john@acme.inc", "en"));
|
| @@ -77,7 +67,7 @@ public class AutofillPopupWithKeyboardTest extends ChromeActivityTestCaseBase<Ch
|
| ThreadUtils.runOnUiThreadBlocking(new Runnable() {
|
| @Override
|
| public void run() {
|
| - viewCoreRef.set(getActivity().getCurrentContentViewCore());
|
| + viewCoreRef.set(getActivity().getActiveContentViewCore());
|
| webContentsRef.set(viewCoreRef.get().getWebContents());
|
| viewRef.set(viewCoreRef.get().getContainerView());
|
| }
|
| @@ -140,13 +130,13 @@ public class AutofillPopupWithKeyboardTest extends ChromeActivityTestCaseBase<Ch
|
| public boolean isSatisfied() {
|
| return shown == UiUtils.isKeyboardShowing(
|
| getActivity(),
|
| - getActivity().getCurrentContentViewCore().getContainerView());
|
| + getActivity().getActiveContentViewCore().getContainerView());
|
| }
|
| }));
|
| ThreadUtils.runOnUiThreadBlocking(new Runnable() {
|
| @Override
|
| public void run() {
|
| - ContentViewCore viewCore = getActivity().getCurrentContentViewCore();
|
| + ContentViewCore viewCore = getActivity().getActiveContentViewCore();
|
| viewCore.onSizeChanged(viewCore.getViewportWidthPix(),
|
| viewCore.getViewportHeightPix() + (shown ? -100 : 100),
|
| viewCore.getViewportWidthPix(), viewCore.getViewportHeightPix());
|
|
|