| Index: chrome/android/javatests_shell/src/org/chromium/chrome/browser/autofill/AutofillDialogControllerTest.java
|
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillDialogControllerTest.java b/chrome/android/javatests_shell/src/org/chromium/chrome/browser/autofill/AutofillDialogControllerTest.java
|
| similarity index 97%
|
| rename from chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillDialogControllerTest.java
|
| rename to chrome/android/javatests_shell/src/org/chromium/chrome/browser/autofill/AutofillDialogControllerTest.java
|
| index 6124cecd10877c77149f5513185d6ef77f020a2a..397ebfb826511efc0750b3ee5764614bb3dd0753 100644
|
| --- a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/AutofillDialogControllerTest.java
|
| +++ b/chrome/android/javatests_shell/src/org/chromium/chrome/browser/autofill/AutofillDialogControllerTest.java
|
| @@ -8,11 +8,10 @@ import android.test.suitebuilder.annotation.MediumTest;
|
| import android.test.suitebuilder.annotation.SmallTest;
|
| import android.text.TextUtils;
|
|
|
| -import org.chromium.base.test.util.CommandLineFlags;
|
| +import org.chromium.base.CommandLine;
|
| import org.chromium.base.test.util.Feature;
|
| import org.chromium.base.test.util.UrlUtils;
|
| -import org.chromium.chrome.browser.ChromeActivity;
|
| -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;
|
| @@ -24,8 +23,8 @@ import java.util.concurrent.TimeoutException;
|
| /**
|
| * Integration tests for the AutofillPopup.
|
| */
|
| -@CommandLineFlags.Add("reduce-security-for-testing")
|
| -public class AutofillDialogControllerTest extends ChromeActivityTestCaseBase<ChromeActivity> {
|
| +public class AutofillDialogControllerTest extends ChromeShellTestBase {
|
| + private static final String SWITCH_REDUCE_SECURITY_FOR_TESTING = "reduce-security-for-testing";
|
| private static final long DIALOG_CALLBACK_DELAY_MILLISECONDS = 50;
|
|
|
| private static final String TEST_NAME = "Joe Doe";
|
| @@ -175,19 +174,12 @@ public class AutofillDialogControllerTest extends ChromeActivityTestCaseBase<Chr
|
| return UrlUtils.encodeHtmlDataUri(sb.toString());
|
| }
|
|
|
| - public AutofillDialogControllerTest() {
|
| - super(ChromeActivity.class);
|
| - }
|
| -
|
| - @Override
|
| - public void startMainActivity() throws InterruptedException {
|
| - // Don't launch activity automatically.
|
| - }
|
| -
|
| @Override
|
| public void setUp() throws Exception {
|
| super.setUp();
|
| clearAppData();
|
| + CommandLine.init(new String[]{});
|
| + CommandLine.getInstance().appendSwitch(SWITCH_REDUCE_SECURITY_FOR_TESTING);
|
| }
|
|
|
| @MediumTest
|
| @@ -545,7 +537,7 @@ public class AutofillDialogControllerTest extends ChromeActivityTestCaseBase<Chr
|
|
|
| setUpAndRequestAutocomplete(url, requestFullBilling, requestShipping, requestPhoneNumbers);
|
|
|
| - final WebContents webContents = getActivity().getCurrentContentViewCore().getWebContents();
|
| + final WebContents webContents = getActivity().getActiveContentViewCore().getWebContents();
|
|
|
| assertEquals(actualId + " did not match",
|
| expected, DOMUtils.getNodeValue(webContents, actualId));
|
| @@ -562,7 +554,7 @@ public class AutofillDialogControllerTest extends ChromeActivityTestCaseBase<Chr
|
| generatePage(requestFullBilling, requestShipping, requestPhoneNumbers),
|
| requestFullBilling, requestShipping, requestPhoneNumbers);
|
|
|
| - final WebContents webContents = getActivity().getCurrentContentViewCore().getWebContents();
|
| + final WebContents webContents = getActivity().getActiveContentViewCore().getWebContents();
|
|
|
| assertEquals("billing name did not match",
|
| TEST_NAME, DOMUtils.getNodeValue(webContents, "id-billing-name"));
|
| @@ -676,10 +668,11 @@ public class AutofillDialogControllerTest extends ChromeActivityTestCaseBase<Chr
|
| final boolean requestPhoneNumbers,
|
| final boolean expectFailure)
|
| throws InterruptedException, TimeoutException {
|
| - startMainActivityWithURL(url);
|
| + launchChromeShellWithUrl(url);
|
| + assertTrue(waitForActiveShellToBeDoneLoading());
|
|
|
| - final ContentViewCore viewCore = getActivity().getCurrentContentViewCore();
|
| - final WebContents webContents = getActivity().getCurrentContentViewCore().getWebContents();
|
| + final ContentViewCore viewCore = getActivity().getActiveContentViewCore();
|
| + final WebContents webContents = getActivity().getActiveContentViewCore().getWebContents();
|
|
|
| AutofillDialogResult.ResultWallet result = new AutofillDialogResult.ResultWallet(
|
| TEST_EMAIL, "Google Transaction ID",
|
|
|