Bug 1834576 - Synchronize GeckoView Gradle dependencies with firefox-android. r=geckoview-reviewers,calu

Fix-ups in this patch:
* Enable multidex on messaging example apps to fix Lite build bustage where we API 16 is still supported
* Switch from deprecated assertThat to Hamcrest version
* Remove usage of deprecated ExpectedException.none()

Differential Revision: https://phabricator.services.mozilla.com/D178819
This commit is contained in:
Ryan VanderMeulen 2023-05-24 01:46:13 +00:00
parent 483267f020
commit 3692e86902
11 changed files with 44 additions and 42 deletions

View File

@ -18,6 +18,7 @@ android {
minSdkVersion project.ext.minSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
@ -42,10 +43,11 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "androidx.annotation:annotation:1.3.0"
implementation "androidx.appcompat:appcompat:1.4.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
testImplementation 'junit:junit:4.13.1'
implementation "androidx.annotation:annotation:1.6.0"
implementation "androidx.appcompat:appcompat:1.6.1"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.multidex:multidex:2.0.1'
testImplementation 'junit:junit:4.13.2'
// Replace this with implementation "org.mozilla.geckoview:geckoview-${geckoviewChannel}:${geckoviewVersion}"
implementation project(path: ':geckoview')
}

View File

@ -10,6 +10,7 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:name="androidx.multidex.MultiDexApplication"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

View File

@ -18,6 +18,7 @@ android {
minSdkVersion project.ext.minSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
@ -42,9 +43,10 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "androidx.annotation:annotation:1.3.0"
implementation "androidx.appcompat:appcompat:1.4.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
testImplementation 'junit:junit:4.13.1'
implementation "androidx.annotation:annotation:1.6.0"
implementation "androidx.appcompat:appcompat:1.6.1"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.multidex:multidex:2.0.1'
testImplementation 'junit:junit:4.13.2'
implementation project(path: ':geckoview')
}

View File

@ -10,6 +10,7 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:name="androidx.multidex.MultiDexApplication"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

View File

@ -219,30 +219,30 @@ configurations {
}
dependencies {
implementation "androidx.annotation:annotation:1.3.0"
implementation "androidx.annotation:annotation:1.6.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "com.google.android.gms:play-services-fido:20.0.1"
implementation "org.yaml:snakeyaml:1.24:android"
implementation "org.yaml:snakeyaml:1.33"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
implementation "androidx.lifecycle:lifecycle-common-java8:2.4.0"
implementation "androidx.lifecycle:lifecycle-common:2.6.1"
implementation "androidx.lifecycle:lifecycle-process:2.6.1"
if (mozconfig.substs.MOZ_ANDROID_HLS_SUPPORT) {
implementation project(":exoplayer2")
}
testImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testImplementation 'junit:junit:4.13.1'
testImplementation 'org.robolectric:robolectric:4.7.3'
testImplementation 'org.mockito:mockito-core:3.11.2'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.10.1'
testImplementation 'org.mockito:mockito-core:5.3.1'
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
androidTestImplementation 'com.koushikdutta.async:androidasync:3.1.0'

View File

@ -3,8 +3,8 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
package org.mozilla.geckoview.test
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.* // ktlint-disable no-wildcard-imports
import org.junit.Assert.assertThat
import org.junit.Test
import org.mozilla.geckoview.GeckoResult
import org.mozilla.geckoview.test.util.Environment

View File

@ -14,9 +14,7 @@ import androidx.test.platform.app.InstrumentationRegistry
import org.hamcrest.Matchers.* // ktlint-disable no-wildcard-imports
import org.junit.Assert
import org.junit.Assume.assumeThat
import org.junit.Rule
import org.junit.Test
import org.junit.rules.ExpectedException
import org.junit.runner.RunWith
import org.mozilla.geckoview.GeckoDisplay.SurfaceInfo
import org.mozilla.geckoview.GeckoResult
@ -39,10 +37,6 @@ private const val BIG_SCREEN_WIDTH = 999999
@RunWith(AndroidJUnit4::class)
@MediumTest
class ScreenshotTest : BaseSessionTest() {
@get:Rule
val expectedEx: ExpectedException = ExpectedException.none()
private fun getComparisonScreenshot(width: Int, height: Int): Bitmap {
val screenshotFile = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888)
val canvas = Canvas(screenshotFile)

View File

@ -15,10 +15,9 @@ import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.* // ktlint-disable no-wildcard-imports
import org.json.JSONObject
import org.junit.After
import org.junit.Assert.assertThrows
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.rules.ExpectedException
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import org.mozilla.gecko.util.ThreadUtils
@ -56,8 +55,6 @@ class WebExecutorTest {
lateinit var executor: GeckoWebExecutor
lateinit var server: TestServer
@get:Rule val thrown = ExpectedException.none()
@Before
fun setup() {
// Using @UiThreadTest here does not seem to block
@ -188,8 +185,10 @@ class WebExecutorTest {
@Test
fun testRedirectLoop() {
thrown.expect(equalTo(WebRequestError(WebRequestError.ERROR_REDIRECT_LOOP, WebRequestError.ERROR_CATEGORY_NETWORK)))
fetch(webRequest("$TEST_ENDPOINT/redirect/100"))
val thrown = assertThrows(WebRequestError::class.java) {
fetch(webRequest("$TEST_ENDPOINT/redirect/100"))
}
assertThat(thrown, equalTo(WebRequestError(WebRequestError.ERROR_REDIRECT_LOOP, WebRequestError.ERROR_CATEGORY_NETWORK)))
}
@Test
@ -400,8 +399,10 @@ class WebExecutorTest {
@Test
fun testFetchUnknownHost() {
thrown.expect(equalTo(WebRequestError(WebRequestError.ERROR_UNKNOWN_HOST, WebRequestError.ERROR_CATEGORY_URI)))
fetch(webRequest("https://this.should.not.resolve"))
val thrown = assertThrows(WebRequestError::class.java) {
fetch(webRequest("https://this.should.not.resolve"))
}
assertThat(thrown, equalTo(WebRequestError(WebRequestError.ERROR_UNKNOWN_HOST, WebRequestError.ERROR_CATEGORY_URI)))
}
@Test(expected = UnknownHostException::class)

View File

@ -6,6 +6,7 @@ package org.mozilla.geckoview.test
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.MediumTest
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.core.IsEqual.equalTo
import org.hamcrest.core.StringEndsWith.endsWith
import org.json.JSONObject

View File

@ -47,13 +47,13 @@ android {
}
dependencies {
implementation "androidx.annotation:annotation:1.3.0"
implementation "androidx.appcompat:appcompat:1.4.0"
implementation "androidx.annotation:annotation:1.6.0"
implementation "androidx.appcompat:appcompat:1.6.1"
implementation "androidx.preference:preference:1.1.1"
implementation project(path: ':geckoview')
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.multidex:multidex:2.0.1'
}

View File

@ -47,13 +47,13 @@ android {
}
dependencies {
implementation "androidx.annotation:annotation:1.3.0"
implementation "androidx.appcompat:appcompat:1.4.0"
implementation "androidx.annotation:annotation:1.6.0"
implementation "androidx.appcompat:appcompat:1.6.1"
implementation "androidx.preference:preference:1.1.1"
implementation project(path: ':geckoview')
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.multidex:multidex:2.0.1'
}