2019-07-12 20:38:15 +02:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* 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/. */
|
|
|
|
|
2019-05-07 23:36:37 +02:00
|
|
|
package org.mozilla.fenix.components
|
|
|
|
|
|
|
|
import android.content.Context
|
|
|
|
import io.mockk.mockk
|
2019-08-07 23:00:53 +02:00
|
|
|
import kotlinx.coroutines.ObsoleteCoroutinesApi
|
2019-05-07 23:36:37 +02:00
|
|
|
|
2019-08-07 23:00:53 +02:00
|
|
|
@ObsoleteCoroutinesApi
|
2019-05-07 23:36:37 +02:00
|
|
|
class TestComponents(private val context: Context) : Components(context) {
|
|
|
|
override val backgroundServices by lazy {
|
|
|
|
mockk<BackgroundServices>(relaxed = true)
|
|
|
|
}
|
2019-06-05 01:45:31 +02:00
|
|
|
override val services by lazy { Services(backgroundServices.accountManager) }
|
2019-05-07 23:36:37 +02:00
|
|
|
override val core by lazy { TestCore(context) }
|
|
|
|
override val search by lazy { Search(context) }
|
2019-05-17 15:45:43 +02:00
|
|
|
override val useCases by lazy { UseCases(context, core.sessionManager, core.engine.settings, search.searchEngineManager) }
|
2019-05-07 23:36:37 +02:00
|
|
|
override val utils by lazy {
|
|
|
|
Utilities(
|
|
|
|
context,
|
|
|
|
core.sessionManager,
|
|
|
|
useCases.sessionUseCases,
|
|
|
|
useCases.searchUseCases
|
|
|
|
)
|
|
|
|
}
|
|
|
|
override val analytics by lazy { Analytics(context) }
|
2019-07-12 20:38:15 +02:00
|
|
|
}
|