Pass along crash reporter instance to PlacesHistoryStorage

pull/35/head
Grisha Kruglov 4 years ago committed by Emily Kager
parent 75c496f237
commit f694861f1f

@ -44,7 +44,7 @@ class Components(private val context: Context) {
)
}
val services by lazy { Services(context, backgroundServices.accountManager) }
val core by lazy { Core(context) }
val core by lazy { Core(context, analytics.crashReporter) }
val search by lazy { Search(context) }
val useCases by lazy {
UseCases(

@ -46,6 +46,7 @@ import mozilla.components.service.digitalassetlinks.RelationChecker
import mozilla.components.service.digitalassetlinks.local.StatementApi
import mozilla.components.service.digitalassetlinks.local.StatementRelationChecker
import mozilla.components.service.sync.logins.SyncableLoginsStorage
import mozilla.components.support.base.crash.CrashReporting
import org.mozilla.fenix.AppRequestInterceptor
import org.mozilla.fenix.Config
import org.mozilla.fenix.HomeActivity
@ -63,7 +64,7 @@ import java.util.concurrent.TimeUnit
* Component group for all core browser functionality.
*/
@Mockable
class Core(private val context: Context) {
class Core(private val context: Context, private val crashReporter: CrashReporting) {
/**
* The browser engine component initialized based on the build
* configuration (see build variants).
@ -228,7 +229,7 @@ class Core(private val context: Context) {
// Use these for startup-path code, where we don't want to do any work that's not strictly necessary.
// For example, this is how the GeckoEngine delegates (history, logins) are configured.
// We can fully initialize GeckoEngine without initialized our storage.
val lazyHistoryStorage = lazy { PlacesHistoryStorage(context) }
val lazyHistoryStorage = lazy { PlacesHistoryStorage(context, crashReporter) }
val lazyBookmarksStorage = lazy { PlacesBookmarksStorage(context) }
val lazyPasswordsStorage = lazy { SyncableLoginsStorage(context, passwordsEncryptionKey) }

@ -14,7 +14,7 @@ class TestComponents(private val context: Context) : Components(context) {
mockk<BackgroundServices>(relaxed = true)
}
override val services by lazy { Services(context, backgroundServices.accountManager) }
override val core by lazy { TestCore(context) }
override val core by lazy { TestCore(context, analytics.crashReporter) }
override val search by lazy { Search(context) }
override val useCases by lazy {
UseCases(

@ -14,8 +14,9 @@ import mozilla.components.concept.engine.Engine
import mozilla.components.concept.engine.Settings
import mozilla.components.concept.fetch.Client
import mozilla.components.feature.pwa.WebAppShortcutManager
import mozilla.components.support.base.crash.CrashReporting
class TestCore(context: Context) : Core(context) {
class TestCore(context: Context, crashReporter: CrashReporting) : Core(context, crashReporter) {
override val engine = mockk<Engine>(relaxed = true) {
every { this@mockk getProperty "settings" } returns mockk<Settings>(relaxed = true)

Loading…
Cancel
Save