Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: chrome/android/javatests_shell/src/org/chromium/chrome/browser/autofill/AutofillDialogControllerTest.java

Issue 1243273002: Revert: Reland: Move autofill tests chrome ChromeShellTest to ChromePublicTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 d196c99fc0befbdfe1d3eaa3567a794b20d122a8..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,13 +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.
+ public void setUp() throws Exception {
+ super.setUp();
+ clearAppData();
+ CommandLine.init(new String[]{});
+ CommandLine.getInstance().appendSwitch(SWITCH_REDUCE_SECURITY_FOR_TESTING);
}
@MediumTest
@@ -539,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));
@@ -556,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"));
@@ -670,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",

Powered by Google App Engine
This is Rietveld 408576698