2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00
This commit is contained in:
Emily Kager 2019-08-15 11:05:23 -04:00 committed by Sawyer Blatz
parent b037ddee5a
commit 52ff9a61f0

View File

@ -4,6 +4,7 @@
package org.mozilla.fenix.helpers
import android.content.Context
import java.io.IOException
import android.net.Uri
@ -14,7 +15,6 @@ import okhttp3.mockwebserver.Dispatcher
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.MockWebServer
import okhttp3.mockwebserver.RecordedRequest
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.helpers.ext.toUri
object MockWebServerHelper {
@ -48,7 +48,7 @@ class AndroidAssetDispatcher : Dispatcher() {
private val mainThreadHandler = Handler(Looper.getMainLooper())
override fun dispatch(request: RecordedRequest): MockResponse {
val assetManager = ApplicationProvider.getApplicationContext<HomeActivity>().assets
val assetManager = ApplicationProvider.getApplicationContext<Context>().assets
val assetContents = try {
val pathNoLeadingSlash = request.path.drop(1)
assetManager.open(pathNoLeadingSlash).use { inputStream ->