1
0
Fork 0

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
Michael Comella 2020-04-03 15:20:11 -07:00 committed by Michael Comella
parent 716dbf2d57
commit 4437ddd536
21 changed files with 23 additions and 21 deletions

View File

@ -272,7 +272,7 @@ android.applicationVariants.all { variant ->
if (hasTest) {
apply plugin: 'kotlin-allopen'
allOpen {
annotation("org.mozilla.fenix.test.OpenClass")
annotation("org.mozilla.fenix.utils.OpenClass")
}
}

View File

@ -21,7 +21,7 @@ import org.mozilla.fenix.components.metrics.GleanMetricsService
import org.mozilla.fenix.components.metrics.LeanplumMetricsService
import org.mozilla.fenix.components.metrics.MetricController
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_VENDOR
import org.mozilla.geckoview.BuildConfig.MOZ_APP_VERSION

View File

@ -35,7 +35,7 @@ import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.components.metrics.MetricController
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.test.Mockable
import org.mozilla.fenix.utils.Mockable
import org.mozilla.fenix.utils.RunWhenReadyQueue
/**

View File

@ -19,7 +19,7 @@ import mozilla.components.lib.publicsuffixlist.PublicSuffixList
import mozilla.components.support.migration.state.MigrationStore
import org.mozilla.fenix.BuildConfig
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.wifi.WifiConnectionMonitor
import java.util.concurrent.TimeUnit

View File

@ -45,7 +45,7 @@ import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.media.MediaService
import org.mozilla.fenix.test.Mockable
import org.mozilla.fenix.utils.Mockable
import java.util.concurrent.TimeUnit
/**

View File

@ -21,7 +21,7 @@ import org.mozilla.fenix.FeatureFlags
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.increaseTapArea
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.test.Mockable
import org.mozilla.fenix.utils.Mockable
@Mockable
class FenixSnackbar private constructor(

View File

@ -13,7 +13,7 @@ import mozilla.components.concept.engine.EngineView
import mozilla.components.feature.findinpage.FindInPageFeature
import mozilla.components.feature.findinpage.view.FindInPageView
import mozilla.components.support.base.feature.LifecycleAwareFeature
import org.mozilla.fenix.test.Mockable
import org.mozilla.fenix.utils.Mockable
@Mockable
class FindInPageIntegration(

View File

@ -20,7 +20,7 @@ import mozilla.components.support.migration.state.MigrationStore
import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.customtabs.FennecWebAppIntentProcessor
import org.mozilla.fenix.home.intent.FennecBookmarkShortcutsIntentProcessor
import org.mozilla.fenix.test.Mockable
import org.mozilla.fenix.utils.Mockable
/**
* Component group for miscellaneous components.

View File

@ -10,7 +10,7 @@ import mozilla.components.feature.sitepermissions.SitePermissions
import mozilla.components.feature.sitepermissions.SitePermissions.Status
import mozilla.components.feature.sitepermissions.SitePermissionsStorage
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.test.Mockable
import org.mozilla.fenix.utils.Mockable
@Mockable
class PermissionStorage(private val context: Context) {

View File

@ -11,7 +11,7 @@ import kotlinx.coroutines.launch
import mozilla.components.browser.search.SearchEngineManager
import org.mozilla.fenix.components.searchengine.FenixSearchEngineProvider
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.

View File

@ -21,7 +21,7 @@ import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.getPreferenceKey
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.

View File

@ -17,7 +17,7 @@ import mozilla.components.support.base.observer.ObserverRegistry
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.toShortUrl
import org.mozilla.fenix.home.sessioncontrol.viewholders.CollectionViewHolder
import org.mozilla.fenix.test.Mockable
import org.mozilla.fenix.utils.Mockable
@Mockable
class TabCollectionStorage(

View File

@ -17,7 +17,7 @@ import org.mozilla.fenix.R
import org.mozilla.fenix.ext.settings
import org.mozilla.fenix.settings.SupportUtils
import org.mozilla.fenix.settings.advanced.getSelectedLocale
import org.mozilla.fenix.test.Mockable
import org.mozilla.fenix.utils.Mockable
@Mockable
class TopSiteStorage(private val context: Context) {

View File

@ -18,7 +18,7 @@ import mozilla.components.feature.search.SearchUseCases
import mozilla.components.feature.session.SessionUseCases
import mozilla.components.feature.session.SettingsUseCases
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

View File

@ -40,7 +40,7 @@ import org.mozilla.fenix.ext.getRootView
import org.mozilla.fenix.ext.nav
import org.mozilla.fenix.ext.settings
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
/**

View File

@ -9,7 +9,7 @@ import mozilla.components.concept.storage.BookmarkNodeType
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.components.metrics.MetricController
import org.mozilla.fenix.lib.Do
import org.mozilla.fenix.utils.Do
/**
* Interactor for the Bookmarks screen.

View File

@ -11,7 +11,7 @@ import kotlinx.android.synthetic.main.library_site_item.view.*
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.hideAndDisable
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.history.HistoryFragmentState
import org.mozilla.fenix.library.history.HistoryInteractor

View File

@ -22,7 +22,7 @@ import org.mozilla.fenix.R
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.ext.requireComponents
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.about.AboutItemType.LICENSING_INFO
import org.mozilla.fenix.settings.about.AboutItemType.PRIVACY_NOTICE

View File

@ -14,7 +14,7 @@ import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.account_share_list_item.view.*
import mozilla.components.concept.sync.DeviceType
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.listadapters.SyncShareOption

View File

@ -2,7 +2,7 @@
* 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/. */
package org.mozilla.fenix.lib
package org.mozilla.fenix.utils
object Do {

View File

@ -2,7 +2,9 @@
* 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/. */
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