No issue: Move Do and OpenClass to utils pkg.
They were both in their packages by themselves, which feels unnecessary. Unfortunately, a utils pkg is discouraged by kotlin but we don't have a better place for them right now. Maybe an annotations/ pkg for the latter?master
parent
716dbf2d57
commit
4437ddd536
|
@ -272,7 +272,7 @@ android.applicationVariants.all { variant ->
|
||||||
if (hasTest) {
|
if (hasTest) {
|
||||||
apply plugin: 'kotlin-allopen'
|
apply plugin: 'kotlin-allopen'
|
||||||
allOpen {
|
allOpen {
|
||||||
annotation("org.mozilla.fenix.test.OpenClass")
|
annotation("org.mozilla.fenix.utils.OpenClass")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import org.mozilla.fenix.components.metrics.GleanMetricsService
|
||||||
import org.mozilla.fenix.components.metrics.LeanplumMetricsService
|
import org.mozilla.fenix.components.metrics.LeanplumMetricsService
|
||||||
import org.mozilla.fenix.components.metrics.MetricController
|
import org.mozilla.fenix.components.metrics.MetricController
|
||||||
import org.mozilla.fenix.ext.settings
|
import org.mozilla.fenix.ext.settings
|
||||||
import org.mozilla.fenix.test.Mockable
|
import org.mozilla.fenix.utils.Mockable
|
||||||
import org.mozilla.geckoview.BuildConfig.MOZ_APP_BUILDID
|
import org.mozilla.geckoview.BuildConfig.MOZ_APP_BUILDID
|
||||||
import org.mozilla.geckoview.BuildConfig.MOZ_APP_VENDOR
|
import org.mozilla.geckoview.BuildConfig.MOZ_APP_VENDOR
|
||||||
import org.mozilla.geckoview.BuildConfig.MOZ_APP_VERSION
|
import org.mozilla.geckoview.BuildConfig.MOZ_APP_VERSION
|
||||||
|
|
|
@ -35,7 +35,7 @@ import org.mozilla.fenix.components.metrics.Event
|
||||||
import org.mozilla.fenix.components.metrics.MetricController
|
import org.mozilla.fenix.components.metrics.MetricController
|
||||||
import org.mozilla.fenix.ext.components
|
import org.mozilla.fenix.ext.components
|
||||||
import org.mozilla.fenix.ext.settings
|
import org.mozilla.fenix.ext.settings
|
||||||
import org.mozilla.fenix.test.Mockable
|
import org.mozilla.fenix.utils.Mockable
|
||||||
import org.mozilla.fenix.utils.RunWhenReadyQueue
|
import org.mozilla.fenix.utils.RunWhenReadyQueue
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,7 +19,7 @@ import mozilla.components.lib.publicsuffixlist.PublicSuffixList
|
||||||
import mozilla.components.support.migration.state.MigrationStore
|
import mozilla.components.support.migration.state.MigrationStore
|
||||||
import org.mozilla.fenix.BuildConfig
|
import org.mozilla.fenix.BuildConfig
|
||||||
import org.mozilla.fenix.HomeActivity
|
import org.mozilla.fenix.HomeActivity
|
||||||
import org.mozilla.fenix.test.Mockable
|
import org.mozilla.fenix.utils.Mockable
|
||||||
import org.mozilla.fenix.utils.ClipboardHandler
|
import org.mozilla.fenix.utils.ClipboardHandler
|
||||||
import org.mozilla.fenix.wifi.WifiConnectionMonitor
|
import org.mozilla.fenix.wifi.WifiConnectionMonitor
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
|
@ -45,7 +45,7 @@ import org.mozilla.fenix.HomeActivity
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.ext.settings
|
import org.mozilla.fenix.ext.settings
|
||||||
import org.mozilla.fenix.media.MediaService
|
import org.mozilla.fenix.media.MediaService
|
||||||
import org.mozilla.fenix.test.Mockable
|
import org.mozilla.fenix.utils.Mockable
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,7 +21,7 @@ import org.mozilla.fenix.FeatureFlags
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.ext.increaseTapArea
|
import org.mozilla.fenix.ext.increaseTapArea
|
||||||
import org.mozilla.fenix.ext.settings
|
import org.mozilla.fenix.ext.settings
|
||||||
import org.mozilla.fenix.test.Mockable
|
import org.mozilla.fenix.utils.Mockable
|
||||||
|
|
||||||
@Mockable
|
@Mockable
|
||||||
class FenixSnackbar private constructor(
|
class FenixSnackbar private constructor(
|
||||||
|
|
|
@ -13,7 +13,7 @@ import mozilla.components.concept.engine.EngineView
|
||||||
import mozilla.components.feature.findinpage.FindInPageFeature
|
import mozilla.components.feature.findinpage.FindInPageFeature
|
||||||
import mozilla.components.feature.findinpage.view.FindInPageView
|
import mozilla.components.feature.findinpage.view.FindInPageView
|
||||||
import mozilla.components.support.base.feature.LifecycleAwareFeature
|
import mozilla.components.support.base.feature.LifecycleAwareFeature
|
||||||
import org.mozilla.fenix.test.Mockable
|
import org.mozilla.fenix.utils.Mockable
|
||||||
|
|
||||||
@Mockable
|
@Mockable
|
||||||
class FindInPageIntegration(
|
class FindInPageIntegration(
|
||||||
|
|
|
@ -20,7 +20,7 @@ import mozilla.components.support.migration.state.MigrationStore
|
||||||
import org.mozilla.fenix.BuildConfig
|
import org.mozilla.fenix.BuildConfig
|
||||||
import org.mozilla.fenix.customtabs.FennecWebAppIntentProcessor
|
import org.mozilla.fenix.customtabs.FennecWebAppIntentProcessor
|
||||||
import org.mozilla.fenix.home.intent.FennecBookmarkShortcutsIntentProcessor
|
import org.mozilla.fenix.home.intent.FennecBookmarkShortcutsIntentProcessor
|
||||||
import org.mozilla.fenix.test.Mockable
|
import org.mozilla.fenix.utils.Mockable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component group for miscellaneous components.
|
* Component group for miscellaneous components.
|
||||||
|
|
|
@ -10,7 +10,7 @@ import mozilla.components.feature.sitepermissions.SitePermissions
|
||||||
import mozilla.components.feature.sitepermissions.SitePermissions.Status
|
import mozilla.components.feature.sitepermissions.SitePermissions.Status
|
||||||
import mozilla.components.feature.sitepermissions.SitePermissionsStorage
|
import mozilla.components.feature.sitepermissions.SitePermissionsStorage
|
||||||
import org.mozilla.fenix.ext.components
|
import org.mozilla.fenix.ext.components
|
||||||
import org.mozilla.fenix.test.Mockable
|
import org.mozilla.fenix.utils.Mockable
|
||||||
|
|
||||||
@Mockable
|
@Mockable
|
||||||
class PermissionStorage(private val context: Context) {
|
class PermissionStorage(private val context: Context) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import kotlinx.coroutines.launch
|
||||||
import mozilla.components.browser.search.SearchEngineManager
|
import mozilla.components.browser.search.SearchEngineManager
|
||||||
import org.mozilla.fenix.components.searchengine.FenixSearchEngineProvider
|
import org.mozilla.fenix.components.searchengine.FenixSearchEngineProvider
|
||||||
import org.mozilla.fenix.ext.settings
|
import org.mozilla.fenix.ext.settings
|
||||||
import org.mozilla.fenix.test.Mockable
|
import org.mozilla.fenix.utils.Mockable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component group for all search engine integration related functionality.
|
* Component group for all search engine integration related functionality.
|
||||||
|
|
|
@ -21,7 +21,7 @@ import org.mozilla.fenix.components.metrics.Event
|
||||||
import org.mozilla.fenix.ext.components
|
import org.mozilla.fenix.ext.components
|
||||||
import org.mozilla.fenix.ext.getPreferenceKey
|
import org.mozilla.fenix.ext.getPreferenceKey
|
||||||
import org.mozilla.fenix.settings.SupportUtils
|
import org.mozilla.fenix.settings.SupportUtils
|
||||||
import org.mozilla.fenix.test.Mockable
|
import org.mozilla.fenix.utils.Mockable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component group which encapsulates foreground-friendly services.
|
* Component group which encapsulates foreground-friendly services.
|
||||||
|
|
|
@ -17,7 +17,7 @@ import mozilla.components.support.base.observer.ObserverRegistry
|
||||||
import org.mozilla.fenix.ext.components
|
import org.mozilla.fenix.ext.components
|
||||||
import org.mozilla.fenix.ext.toShortUrl
|
import org.mozilla.fenix.ext.toShortUrl
|
||||||
import org.mozilla.fenix.home.sessioncontrol.viewholders.CollectionViewHolder
|
import org.mozilla.fenix.home.sessioncontrol.viewholders.CollectionViewHolder
|
||||||
import org.mozilla.fenix.test.Mockable
|
import org.mozilla.fenix.utils.Mockable
|
||||||
|
|
||||||
@Mockable
|
@Mockable
|
||||||
class TabCollectionStorage(
|
class TabCollectionStorage(
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.ext.settings
|
import org.mozilla.fenix.ext.settings
|
||||||
import org.mozilla.fenix.settings.SupportUtils
|
import org.mozilla.fenix.settings.SupportUtils
|
||||||
import org.mozilla.fenix.settings.advanced.getSelectedLocale
|
import org.mozilla.fenix.settings.advanced.getSelectedLocale
|
||||||
import org.mozilla.fenix.test.Mockable
|
import org.mozilla.fenix.utils.Mockable
|
||||||
|
|
||||||
@Mockable
|
@Mockable
|
||||||
class TopSiteStorage(private val context: Context) {
|
class TopSiteStorage(private val context: Context) {
|
||||||
|
|
|
@ -18,7 +18,7 @@ import mozilla.components.feature.search.SearchUseCases
|
||||||
import mozilla.components.feature.session.SessionUseCases
|
import mozilla.components.feature.session.SessionUseCases
|
||||||
import mozilla.components.feature.session.SettingsUseCases
|
import mozilla.components.feature.session.SettingsUseCases
|
||||||
import mozilla.components.feature.tabs.TabsUseCases
|
import mozilla.components.feature.tabs.TabsUseCases
|
||||||
import org.mozilla.fenix.test.Mockable
|
import org.mozilla.fenix.utils.Mockable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component group for all use cases. Use cases are provided by feature
|
* Component group for all use cases. Use cases are provided by feature
|
||||||
|
|
|
@ -40,7 +40,7 @@ import org.mozilla.fenix.ext.getRootView
|
||||||
import org.mozilla.fenix.ext.nav
|
import org.mozilla.fenix.ext.nav
|
||||||
import org.mozilla.fenix.ext.settings
|
import org.mozilla.fenix.ext.settings
|
||||||
import org.mozilla.fenix.home.SharedViewModel
|
import org.mozilla.fenix.home.SharedViewModel
|
||||||
import org.mozilla.fenix.lib.Do
|
import org.mozilla.fenix.utils.Do
|
||||||
import org.mozilla.fenix.settings.deletebrowsingdata.deleteAndQuit
|
import org.mozilla.fenix.settings.deletebrowsingdata.deleteAndQuit
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -9,7 +9,7 @@ import mozilla.components.concept.storage.BookmarkNodeType
|
||||||
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
|
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
|
||||||
import org.mozilla.fenix.components.metrics.Event
|
import org.mozilla.fenix.components.metrics.Event
|
||||||
import org.mozilla.fenix.components.metrics.MetricController
|
import org.mozilla.fenix.components.metrics.MetricController
|
||||||
import org.mozilla.fenix.lib.Do
|
import org.mozilla.fenix.utils.Do
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interactor for the Bookmarks screen.
|
* Interactor for the Bookmarks screen.
|
||||||
|
|
|
@ -11,7 +11,7 @@ import kotlinx.android.synthetic.main.library_site_item.view.*
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.ext.hideAndDisable
|
import org.mozilla.fenix.ext.hideAndDisable
|
||||||
import org.mozilla.fenix.ext.showAndEnable
|
import org.mozilla.fenix.ext.showAndEnable
|
||||||
import org.mozilla.fenix.lib.Do
|
import org.mozilla.fenix.utils.Do
|
||||||
import org.mozilla.fenix.library.SelectionHolder
|
import org.mozilla.fenix.library.SelectionHolder
|
||||||
import org.mozilla.fenix.library.history.HistoryFragmentState
|
import org.mozilla.fenix.library.history.HistoryFragmentState
|
||||||
import org.mozilla.fenix.library.history.HistoryInteractor
|
import org.mozilla.fenix.library.history.HistoryInteractor
|
||||||
|
|
|
@ -22,7 +22,7 @@ import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.components.metrics.Event
|
import org.mozilla.fenix.components.metrics.Event
|
||||||
import org.mozilla.fenix.ext.requireComponents
|
import org.mozilla.fenix.ext.requireComponents
|
||||||
import org.mozilla.fenix.ext.settings
|
import org.mozilla.fenix.ext.settings
|
||||||
import org.mozilla.fenix.lib.Do
|
import org.mozilla.fenix.utils.Do
|
||||||
import org.mozilla.fenix.settings.SupportUtils
|
import org.mozilla.fenix.settings.SupportUtils
|
||||||
import org.mozilla.fenix.settings.about.AboutItemType.LICENSING_INFO
|
import org.mozilla.fenix.settings.about.AboutItemType.LICENSING_INFO
|
||||||
import org.mozilla.fenix.settings.about.AboutItemType.PRIVACY_NOTICE
|
import org.mozilla.fenix.settings.about.AboutItemType.PRIVACY_NOTICE
|
||||||
|
|
|
@ -14,7 +14,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||||
import kotlinx.android.synthetic.main.account_share_list_item.view.*
|
import kotlinx.android.synthetic.main.account_share_list_item.view.*
|
||||||
import mozilla.components.concept.sync.DeviceType
|
import mozilla.components.concept.sync.DeviceType
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.lib.Do
|
import org.mozilla.fenix.utils.Do
|
||||||
import org.mozilla.fenix.share.ShareToAccountDevicesInteractor
|
import org.mozilla.fenix.share.ShareToAccountDevicesInteractor
|
||||||
import org.mozilla.fenix.share.listadapters.SyncShareOption
|
import org.mozilla.fenix.share.listadapters.SyncShareOption
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
package org.mozilla.fenix.lib
|
package org.mozilla.fenix.utils
|
||||||
|
|
||||||
object Do {
|
object Do {
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
package org.mozilla.fenix.test
|
package org.mozilla.fenix.utils
|
||||||
|
|
||||||
|
// Annotations for testing.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Annotate a class with [OpenClass] to open a class for mocking purposes while keeping it final in release builds
|
* Annotate a class with [OpenClass] to open a class for mocking purposes while keeping it final in release builds
|
Loading…
Reference in New Issue