From 8f5b5460c956435bc437ac858d65e3281200f3c3 Mon Sep 17 00:00:00 2001 From: MickeyMoz Date: Thu, 17 Jan 2019 20:13:41 +0000 Subject: [PATCH 1/2] Update GeckoView (20190117-201340) --- buildSrc/src/main/java/Gecko.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/Gecko.kt b/buildSrc/src/main/java/Gecko.kt index f0e64db603d..1f15ee71324 100644 --- a/buildSrc/src/main/java/Gecko.kt +++ b/buildSrc/src/main/java/Gecko.kt @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ internal object GeckoVersions { - const val nightly_version = "66.0.20190111093148" + const val nightly_version = "66.0.20190117095319" const val beta_version = "65.0.20181211223337" const val release_version = "64.0.20181214004633" } From 9459726d62849910b3ae0662fb6af5685315c8cc Mon Sep 17 00:00:00 2001 From: Denys M Date: Sun, 26 May 2019 02:44:32 +0300 Subject: [PATCH 2/2] For #2346. Enable kotlin warningsAsErrors for `lib-fetch-okhttp` module. --- buildSrc/src/main/java/KotlinCompiler.kt | 1 - components/lib/fetch-okhttp/build.gradle | 2 ++ .../mozilla/components/lib/fetch/okhttp/OkHttpClient.kt | 6 ++---- .../components/lib/fetch/okhttp/OkHttpFetchTestCases.kt | 5 +++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/buildSrc/src/main/java/KotlinCompiler.kt b/buildSrc/src/main/java/KotlinCompiler.kt index 51ee96b665a..6296b450446 100644 --- a/buildSrc/src/main/java/KotlinCompiler.kt +++ b/buildSrc/src/main/java/KotlinCompiler.kt @@ -27,7 +27,6 @@ object KotlinCompiler { "feature-session", "feature-sitepermissions", "feature-tabs", - "lib-fetch-okhttp", "samples-toolbar", "service-glean", "support-test", diff --git a/components/lib/fetch-okhttp/build.gradle b/components/lib/fetch-okhttp/build.gradle index 605fc9aad1d..b3935653ddc 100644 --- a/components/lib/fetch-okhttp/build.gradle +++ b/components/lib/fetch-okhttp/build.gradle @@ -30,6 +30,8 @@ dependencies { implementation project(':concept-fetch') + testImplementation project(':support-test') + testImplementation Dependencies.testing_junit testImplementation Dependencies.testing_robolectric testImplementation Dependencies.testing_mockito diff --git a/components/lib/fetch-okhttp/src/main/java/mozilla/components/lib/fetch/okhttp/OkHttpClient.kt b/components/lib/fetch-okhttp/src/main/java/mozilla/components/lib/fetch/okhttp/OkHttpClient.kt index 48cf9cf2d82..1b0ab9bbd7c 100644 --- a/components/lib/fetch-okhttp/src/main/java/mozilla/components/lib/fetch/okhttp/OkHttpClient.kt +++ b/components/lib/fetch-okhttp/src/main/java/mozilla/components/lib/fetch/okhttp/OkHttpClient.kt @@ -58,7 +58,7 @@ class OkHttpClient( } } -private fun okhttp3.OkHttpClient.rebuildFor(request: Request, context: Context?): okhttp3.OkHttpClient { +private fun OkHttpClient.rebuildFor(request: Request, context: Context?): OkHttpClient { @Suppress("ComplexCondition") if (request.connectTimeout != null || request.readTimeout != null || @@ -105,11 +105,9 @@ private fun createRequestBuilderWithBody(request: Request): RequestBuilder { RequestBody.create(null, body.useStream { it.readBytes() }) } - val requestBuilder = RequestBuilder() + return RequestBuilder() .url(request.url) .method(request.method.name, requestBody) - - return requestBuilder } private fun RequestBuilder.addHeadersFrom(request: Request, defaultHeaders: Headers) { diff --git a/components/lib/fetch-okhttp/src/test/java/mozilla/components/lib/fetch/okhttp/OkHttpFetchTestCases.kt b/components/lib/fetch-okhttp/src/test/java/mozilla/components/lib/fetch/okhttp/OkHttpFetchTestCases.kt index 0091827b7de..91287561890 100644 --- a/components/lib/fetch-okhttp/src/test/java/mozilla/components/lib/fetch/okhttp/OkHttpFetchTestCases.kt +++ b/components/lib/fetch-okhttp/src/test/java/mozilla/components/lib/fetch/okhttp/OkHttpFetchTestCases.kt @@ -5,15 +5,16 @@ package mozilla.components.lib.fetch.okhttp import mozilla.components.concept.fetch.Client +import mozilla.components.support.test.robolectric.testContext import org.junit.Assert.assertTrue import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner -import org.robolectric.RuntimeEnvironment @RunWith(RobolectricTestRunner::class) class OkHttpFetchTestCases : mozilla.components.tooling.fetch.tests.FetchTestCases() { - override fun createNewClient(): Client = OkHttpClient(okhttp3.OkHttpClient(), RuntimeEnvironment.application) + + override fun createNewClient(): Client = OkHttpClient(okhttp3.OkHttpClient(), testContext) // Inherits test methods from generic test suite base class