* For #5599: Remove dependency on fetch_httpurlconnection * For #5599: Switch Glean to GeckoViewFetchClient * Use existing Gecko client for Gleanmaster
parent
40e6284aef
commit
b7647a454f
|
@ -422,8 +422,6 @@ dependencies {
|
||||||
debugImplementation Deps.leakcanary
|
debugImplementation Deps.leakcanary
|
||||||
releaseImplementation Deps.leakcanary_noop
|
releaseImplementation Deps.leakcanary_noop
|
||||||
|
|
||||||
implementation Deps.mozilla_lib_fetch_httpurlconnection
|
|
||||||
|
|
||||||
implementation Deps.androidx_legacy
|
implementation Deps.androidx_legacy
|
||||||
implementation Deps.androidx_paging
|
implementation Deps.androidx_paging
|
||||||
implementation Deps.androidx_preference
|
implementation Deps.androidx_preference
|
||||||
|
|
|
@ -12,6 +12,7 @@ import kotlinx.coroutines.runBlocking
|
||||||
import mozilla.components.service.glean.BuildConfig
|
import mozilla.components.service.glean.BuildConfig
|
||||||
import mozilla.components.service.glean.Glean
|
import mozilla.components.service.glean.Glean
|
||||||
import mozilla.components.service.glean.config.Configuration
|
import mozilla.components.service.glean.config.Configuration
|
||||||
|
import mozilla.components.service.glean.net.ConceptFetchHttpUploader
|
||||||
import mozilla.components.service.glean.private.NoExtraKeys
|
import mozilla.components.service.glean.private.NoExtraKeys
|
||||||
import mozilla.components.support.utils.Browsers
|
import mozilla.components.support.utils.Browsers
|
||||||
import org.mozilla.fenix.GleanMetrics.BookmarksManagement
|
import org.mozilla.fenix.GleanMetrics.BookmarksManagement
|
||||||
|
@ -431,7 +432,11 @@ class GleanMetricsService(private val context: Context) : MetricsService {
|
||||||
// can handle events being recorded before it's initialized.
|
// can handle events being recorded before it's initialized.
|
||||||
starter = MainScope().launch {
|
starter = MainScope().launch {
|
||||||
Glean.registerPings(Pings)
|
Glean.registerPings(Pings)
|
||||||
Glean.initialize(context, Configuration(channel = BuildConfig.BUILD_TYPE))
|
Glean.initialize(context,
|
||||||
|
Configuration(channel = BuildConfig.BUILD_TYPE,
|
||||||
|
httpClient = ConceptFetchHttpUploader(
|
||||||
|
lazy(LazyThreadSafetyMode.NONE) { context.components.core.client }
|
||||||
|
)))
|
||||||
}
|
}
|
||||||
|
|
||||||
setStartupMetrics()
|
setStartupMetrics()
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
package org.mozilla.fenix.ext
|
package org.mozilla.fenix.ext
|
||||||
|
|
||||||
import mozilla.components.support.test.robolectric.testContext
|
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import kotlinx.coroutines.ObsoleteCoroutinesApi
|
|
||||||
import io.mockk.verify
|
|
||||||
import io.mockk.spyk
|
import io.mockk.spyk
|
||||||
import mozilla.components.browser.icons.IconRequest
|
import io.mockk.verify
|
||||||
import mozilla.components.lib.fetch.httpurlconnection.HttpURLConnectionClient
|
import kotlinx.coroutines.ObsoleteCoroutinesApi
|
||||||
import org.junit.Test
|
import mozilla.components.browser.engine.gecko.fetch.GeckoViewFetchClient
|
||||||
import org.mozilla.fenix.TestApplication
|
|
||||||
import mozilla.components.browser.icons.BrowserIcons
|
import mozilla.components.browser.icons.BrowserIcons
|
||||||
|
import mozilla.components.browser.icons.IconRequest
|
||||||
|
import mozilla.components.support.test.robolectric.testContext
|
||||||
|
import org.junit.Test
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
import org.mozilla.fenix.TestApplication
|
||||||
import org.robolectric.RobolectricTestRunner
|
import org.robolectric.RobolectricTestRunner
|
||||||
import org.robolectric.annotation.Config
|
import org.robolectric.annotation.Config
|
||||||
import org.junit.runner.RunWith
|
|
||||||
|
|
||||||
@ObsoleteCoroutinesApi
|
@ObsoleteCoroutinesApi
|
||||||
@RunWith(RobolectricTestRunner::class)
|
@RunWith(RobolectricTestRunner::class)
|
||||||
|
@ -22,7 +22,7 @@ class BrowserIconsTest {
|
||||||
@Test
|
@Test
|
||||||
fun loadIntoViewTest() {
|
fun loadIntoViewTest() {
|
||||||
val imageView = spyk(ImageView(testContext))
|
val imageView = spyk(ImageView(testContext))
|
||||||
val icons = spyk(BrowserIcons(testContext, httpClient = HttpURLConnectionClient()))
|
val icons = spyk(BrowserIcons(testContext, httpClient = GeckoViewFetchClient(testContext)))
|
||||||
val myUrl = "https://mozilla.com"
|
val myUrl = "https://mozilla.com"
|
||||||
val request = spyk(IconRequest(url = myUrl))
|
val request = spyk(IconRequest(url = myUrl))
|
||||||
icons.loadIntoView(imageView, myUrl)
|
icons.loadIntoView(imageView, myUrl)
|
||||||
|
|
|
@ -143,7 +143,6 @@ object Deps {
|
||||||
const val mozilla_ui_icons = "org.mozilla.components:ui-icons:${Versions.mozilla_android_components}"
|
const val mozilla_ui_icons = "org.mozilla.components:ui-icons:${Versions.mozilla_android_components}"
|
||||||
|
|
||||||
const val mozilla_lib_crash = "org.mozilla.components:lib-crash:${Versions.mozilla_android_components}"
|
const val mozilla_lib_crash = "org.mozilla.components:lib-crash:${Versions.mozilla_android_components}"
|
||||||
const val mozilla_lib_fetch_httpurlconnection = "org.mozilla.components:lib-fetch-httpurlconnection:${Versions.mozilla_android_components}"
|
|
||||||
const val mozilla_lib_push_firebase = "org.mozilla.components:lib-push-firebase:${Versions.mozilla_android_components}"
|
const val mozilla_lib_push_firebase = "org.mozilla.components:lib-push-firebase:${Versions.mozilla_android_components}"
|
||||||
|
|
||||||
const val mozilla_ui_publicsuffixlist = "org.mozilla.components:lib-publicsuffixlist:${Versions.mozilla_android_components}"
|
const val mozilla_ui_publicsuffixlist = "org.mozilla.components:lib-publicsuffixlist:${Versions.mozilla_android_components}"
|
||||||
|
|
Loading…
Reference in New Issue