| Index: chrome/android/javatests/src/org/chromium/chrome/browser/document/LauncherActivityTest.java
|
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/document/LauncherActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/document/LauncherActivityTest.java
|
| index b9f1d2267eb41b5ca7e5b9eea00ca2c4eacd65ee..20d9998438e2f7811b1beb9ee6a70096deb9c59a 100644
|
| --- a/chrome/android/javatests/src/org/chromium/chrome/browser/document/LauncherActivityTest.java
|
| +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/document/LauncherActivityTest.java
|
| @@ -13,22 +13,13 @@
|
| import android.net.Uri;
|
| import android.os.Parcel;
|
| import android.os.Parcelable;
|
| -import android.support.test.InstrumentationRegistry;
|
| import android.support.test.filters.SmallTest;
|
| -
|
| -import org.junit.Assert;
|
| -import org.junit.Before;
|
| -import org.junit.Test;
|
| -import org.junit.runner.RunWith;
|
|
|
| import org.chromium.base.ApplicationState;
|
| import org.chromium.base.ApplicationStatus;
|
| -import org.chromium.base.test.util.CommandLineFlags;
|
| import org.chromium.base.test.util.RetryOnFailure;
|
| import org.chromium.chrome.browser.ChromeActivity;
|
| -import org.chromium.chrome.browser.ChromeSwitches;
|
| -import org.chromium.chrome.test.ChromeActivityTestRule;
|
| -import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
|
| +import org.chromium.chrome.test.ChromeActivityTestCaseBase;
|
| import org.chromium.content.browser.test.util.Criteria;
|
| import org.chromium.content.browser.test.util.CriteriaHelper;
|
|
|
| @@ -41,20 +32,22 @@
|
| /**
|
| * Tests for launching Chrome.
|
| */
|
| -@RunWith(ChromeJUnit4ClassRunner.class)
|
| @RetryOnFailure
|
| -@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
|
| - ChromeActivityTestRule.DISABLE_NETWORK_PREDICTION_FLAG})
|
| -public class LauncherActivityTest {
|
| +public class LauncherActivityTest extends ChromeActivityTestCaseBase<ChromeActivity> {
|
| +
|
| private Context mContext;
|
| private static final long DEVICE_STARTUP_TIMEOUT_MS = scaleTimeout(15000);
|
|
|
| - @Before
|
| - public void setUp() throws Exception {
|
| - mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
| + public LauncherActivityTest() {
|
| + super(ChromeActivity.class);
|
| }
|
|
|
| - @Test
|
| + @Override
|
| + public void setUp() throws Exception {
|
| + super.setUp();
|
| + mContext = getInstrumentation().getTargetContext();
|
| + }
|
| +
|
| @SmallTest
|
| public void testLaunchWithUrlNoScheme() {
|
| // Prepare intent
|
| @@ -65,10 +58,9 @@
|
|
|
| final Activity startedActivity = tryLaunchingChrome(intent);
|
| final Intent activityIntent = startedActivity.getIntent();
|
| - Assert.assertEquals(intentUrl, activityIntent.getDataString());
|
| + assertEquals(intentUrl, activityIntent.getDataString());
|
| }
|
|
|
| - @Test
|
| @SmallTest
|
| public void testDoesNotCrashWithBadParcel() {
|
| // Prepare bad intent
|
| @@ -85,9 +77,8 @@
|
|
|
| final Activity startedActivity = tryLaunchingChrome(intent);
|
| final Intent activityIntent = startedActivity.getIntent();
|
| - Assert.assertEquals("Data was not preserved", intent.getData(), activityIntent.getData());
|
| - Assert.assertEquals(
|
| - "Action was not preserved", intent.getAction(), activityIntent.getAction());
|
| + assertEquals("Data was not preserved", intent.getData(), activityIntent.getData());
|
| + assertEquals("Action was not preserved", intent.getAction(), activityIntent.getAction());
|
| }
|
|
|
| private Activity tryLaunchingChrome(final Intent intent) {
|
| @@ -118,6 +109,10 @@
|
| return launchedActivity.get();
|
| }
|
|
|
| + @Override
|
| + public void startMainActivity() throws InterruptedException {
|
| + }
|
| +
|
| /**
|
| * This Parcelable does not adhere to the form standards of a well formed Parcelable and will
|
| * thus cause a BadParcelableException. The lint suppression is needed since it detects that
|
|
|