From 774a07d5f7e0012a1d34729e885f7b9959cccb3f Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Wed, 1 Apr 2020 13:26:25 -0700 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/9605: remove unnecessary @RunWith(Robolectric in unit tests. robolectric increases the run time of tests so it's important to remove them when they're unnecessary. Between this change and the last one, the unit test runtime was reduced by ~10s. --- .../fenix/customtabs/ExternalAppBrowserActivityTest.kt | 6 ------ app/src/test/java/org/mozilla/fenix/ext/LogTest.kt | 7 ------- .../test/java/org/mozilla/fenix/ext/NavControllerTest.kt | 6 ------ .../java/org/mozilla/fenix/settings/SupportUtilsTest.kt | 6 ------ 4 files changed, 25 deletions(-) diff --git a/app/src/test/java/org/mozilla/fenix/customtabs/ExternalAppBrowserActivityTest.kt b/app/src/test/java/org/mozilla/fenix/customtabs/ExternalAppBrowserActivityTest.kt index a69ef9e8bd..06eb98c417 100644 --- a/app/src/test/java/org/mozilla/fenix/customtabs/ExternalAppBrowserActivityTest.kt +++ b/app/src/test/java/org/mozilla/fenix/customtabs/ExternalAppBrowserActivityTest.kt @@ -14,18 +14,12 @@ import org.junit.Assert.assertEquals import org.junit.Assert.assertNotNull import org.junit.Assert.assertNull import org.junit.Test -import org.junit.runner.RunWith import org.mockito.Mockito.never import org.mockito.Mockito.spy import org.mockito.Mockito.verify import org.mozilla.fenix.BrowserDirection -import org.mozilla.fenix.TestApplication import org.mozilla.fenix.components.metrics.Event -import org.robolectric.RobolectricTestRunner -import org.robolectric.annotation.Config -@RunWith(RobolectricTestRunner::class) -@Config(application = TestApplication::class) class ExternalAppBrowserActivityTest { @Test diff --git a/app/src/test/java/org/mozilla/fenix/ext/LogTest.kt b/app/src/test/java/org/mozilla/fenix/ext/LogTest.kt index 5a553339f8..9b9ae5212e 100644 --- a/app/src/test/java/org/mozilla/fenix/ext/LogTest.kt +++ b/app/src/test/java/org/mozilla/fenix/ext/LogTest.kt @@ -10,13 +10,6 @@ import io.mockk.mockkStatic import io.mockk.verify import org.junit.Before import org.junit.Test -import org.junit.runner.RunWith -import org.mozilla.fenix.TestApplication -import org.robolectric.RobolectricTestRunner -import org.robolectric.annotation.Config - -@RunWith(RobolectricTestRunner::class) -@Config(application = TestApplication::class) class LogTest { diff --git a/app/src/test/java/org/mozilla/fenix/ext/NavControllerTest.kt b/app/src/test/java/org/mozilla/fenix/ext/NavControllerTest.kt index dfe43af77b..423469a040 100644 --- a/app/src/test/java/org/mozilla/fenix/ext/NavControllerTest.kt +++ b/app/src/test/java/org/mozilla/fenix/ext/NavControllerTest.kt @@ -15,13 +15,7 @@ import io.mockk.mockk import io.mockk.verify import org.junit.Before import org.junit.Test -import org.junit.runner.RunWith -import org.mozilla.fenix.TestApplication -import org.robolectric.RobolectricTestRunner -import org.robolectric.annotation.Config -@RunWith(RobolectricTestRunner::class) -@Config(application = TestApplication::class) class NavControllerTest { private val navController: NavController = mockk(relaxed = true) diff --git a/app/src/test/java/org/mozilla/fenix/settings/SupportUtilsTest.kt b/app/src/test/java/org/mozilla/fenix/settings/SupportUtilsTest.kt index c22a2831ae..9fa0a7bceb 100644 --- a/app/src/test/java/org/mozilla/fenix/settings/SupportUtilsTest.kt +++ b/app/src/test/java/org/mozilla/fenix/settings/SupportUtilsTest.kt @@ -11,14 +11,8 @@ import io.mockk.every import io.mockk.mockk import org.junit.Assert.assertEquals import org.junit.Test -import org.junit.runner.RunWith -import org.mozilla.fenix.TestApplication -import org.robolectric.RobolectricTestRunner -import org.robolectric.annotation.Config import java.util.Locale -@RunWith(RobolectricTestRunner::class) -@Config(application = TestApplication::class) class SupportUtilsTest { @Test