From c9f8986d2b9d0452fd654ba9abbf1979fdee3403 Mon Sep 17 00:00:00 2001 From: Tiger Oakes Date: Tue, 4 Aug 2020 11:18:52 -0700 Subject: [PATCH] Don't init glean in unit tests (#13100) --- app/src/main/java/org/mozilla/fenix/FenixApplication.kt | 4 ++-- .../mozilla/fenix/helpers/FenixRobolectricTestApplication.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt index e9ea55bbc..246cf671b 100644 --- a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +++ b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -12,8 +12,8 @@ import android.util.Log.INFO import androidx.annotation.CallSuper import androidx.appcompat.app.AppCompatDelegate import androidx.core.content.getSystemService -import androidx.work.Configuration.Provider import androidx.work.Configuration.Builder +import androidx.work.Configuration.Provider import kotlinx.coroutines.Deferred import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope @@ -93,7 +93,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider { setupInMainProcessOnly() } - protected fun initializeGlean() { + protected open fun initializeGlean() { val telemetryEnabled = settings().isTelemetryEnabled logger.debug("Initializing Glean (uploadEnabled=$telemetryEnabled, isFennec=${Config.channel.isFennec})") diff --git a/app/src/test/java/org/mozilla/fenix/helpers/FenixRobolectricTestApplication.kt b/app/src/test/java/org/mozilla/fenix/helpers/FenixRobolectricTestApplication.kt index 9e35eef29..076d13cf8 100644 --- a/app/src/test/java/org/mozilla/fenix/helpers/FenixRobolectricTestApplication.kt +++ b/app/src/test/java/org/mozilla/fenix/helpers/FenixRobolectricTestApplication.kt @@ -4,7 +4,6 @@ package org.mozilla.fenix.helpers -import kotlinx.coroutines.ExperimentalCoroutinesApi import org.mozilla.fenix.FenixApplication import org.mozilla.fenix.components.TestComponents @@ -17,8 +16,9 @@ class FenixRobolectricTestApplication : FenixApplication() { override val components = TestComponents(this) + override fun initializeGlean() = Unit + override fun setupInAllProcesses() = Unit - @ExperimentalCoroutinesApi override fun setupInMainProcessOnly() = Unit }