From 52ff9a61f01c38350888fe15fa7af7d94877131e Mon Sep 17 00:00:00 2001 From: Emily Kager Date: Thu, 15 Aug 2019 11:05:23 -0400 Subject: [PATCH] [fenix] For https://github.com/mozilla-mobile/fenix/issues/4688 - Try slightly different Context class for MockWebServer (https://github.com/mozilla-mobile/fenix/pull/4747) --- .../java/org/mozilla/fenix/helpers/MockWebServer.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/androidTest/java/org/mozilla/fenix/helpers/MockWebServer.kt b/app/src/androidTest/java/org/mozilla/fenix/helpers/MockWebServer.kt index 6fd3f15812..46c5fd9141 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/helpers/MockWebServer.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/helpers/MockWebServer.kt @@ -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().assets + val assetManager = ApplicationProvider.getApplicationContext().assets val assetContents = try { val pathNoLeadingSlash = request.path.drop(1) assetManager.open(pathNoLeadingSlash).use { inputStream ->