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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsSectionUnitTest.java

Issue 2954393003: Fix test crashes related to AccountManagerHelper. (Closed)
Patch Set: . Created 3 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/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsSectionUnitTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsSectionUnitTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsSectionUnitTest.java
index e2a6c917344b2cb9e5964d481dddd84c74a62afa..f687ff1b3979778e1776f36797348cf402c0de48 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsSectionUnitTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsSectionUnitTest.java
@@ -8,9 +8,9 @@ import android.support.test.InstrumentationRegistry;
import android.support.test.filters.SmallTest;
import org.junit.Assert;
-import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.RuleChain;
import org.junit.runner.RunWith;
import org.chromium.base.test.BaseJUnit4ClassRunner;
@@ -19,8 +19,8 @@ import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
import org.chromium.chrome.browser.payments.ui.ContactDetailsSection;
import org.chromium.chrome.browser.payments.ui.PaymentOption;
import org.chromium.chrome.browser.payments.ui.SectionInformation;
-import org.chromium.chrome.test.util.ApplicationData;
-import org.chromium.content.browser.test.NativeLibraryTestRule;
+import org.chromium.chrome.browser.test.ChromeBrowserTestRule;
+import org.chromium.chrome.browser.test.ClearAppDataTestRule;
import java.util.ArrayList;
import java.util.List;
@@ -31,18 +31,12 @@ import java.util.List;
@RunWith(BaseJUnit4ClassRunner.class)
public class PaymentRequestContactDetailsSectionUnitTest {
@Rule
- public NativeLibraryTestRule mActivityTestRule = new NativeLibraryTestRule();
+ public final RuleChain mChain =
+ RuleChain.outerRule(new ClearAppDataTestRule()).around(new ChromeBrowserTestRule());
private ContactEditor mContactEditor;
private ContactDetailsSection mContactDetailsSection;
- @Before
- public void setUp() throws Exception {
- ApplicationData.clearAppData(
- InstrumentationRegistry.getInstrumentation().getTargetContext());
- mActivityTestRule.loadNativeLibraryAndInitBrowserProcess();
- }
-
private void createContactDetailsSectionWithProfiles(List<AutofillProfile> autofillProfiles,
boolean requestPayerName, boolean requestPayerPhone, boolean requestPayerEmail) {
mContactEditor = new ContactEditor(requestPayerName, requestPayerPhone, requestPayerEmail);
@@ -336,4 +330,4 @@ public class PaymentRequestContactDetailsSectionUnitTest {
Assert.assertEquals(null, items.get(0).getTertiaryLabel());
Assert.assertEquals("Email required", items.get(0).getEditMessage());
}
-}
+}

Powered by Google App Engine
This is Rietveld 408576698