Closed Bug 1504105 Opened 6 years ago Closed 3 years ago

Replace android.test with something such as android.support.test

Categories

(Firefox for Android Graveyard :: Testing, enhancement, P3)

Unspecified
Android
enhancement

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: m_kato, Unassigned)

Details

From https://developer.android.com/sdk/api_diff/28/changes, android.test is removed when using Android P SDK.

We still use this package in our code. https://searchfox.org/mozilla-central/search?q=android.test&case=false&regexp=false&path=
Summary: Replace android.test with new something such as AndroidX → Replace android.test with something such as android.support.test
Priority: -- → P3

android.support.test doesn't quite seem like a 100% drop-in replacement, though.

It seems that the android.test classes might actually still be available, just that they're no longer included in the on-device framework, and have to be used along the lines of https://developer.android.com/training/testing/set-up-project#add-gradle-dependencies.

Doesn't seem to cause any obvious breakage on Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=a566edcafa62bf2544c1f9281d74977307b028b6&searchStr=android

However I also tested with a P emulator and noticed the interesting side effect that following the suggestions from https://developer.android.com/training/testing/set-up-project#add-gradle-dependencies (i.e. adding 'useLibrary' and making the <uses-library> declarations optional) makes the OS somehow hide those libraries unless we also target Android P.
I.e. any tests that depend on android.test.* cannot be run locally on a device using P or newer unless we also update our target version to P as well.

This is probably not a grave issue, but given that the list of behaviour changes when targeting P looks quite harmless (see also bug 1518225), I'd suggest waiting until merge day and then doing everything in one go to have maximum time for detecting any unexpected fallout.

Assignee: nobody → jh+bugzilla

Will do this as part of bug 1503455 as the changes are rather intertwined anyway. As this doesn't actually seem to block upgrading the compile SDK version I'm unassigning myself again, in case somebody else wants to reduce our dependency on android.test.* for real.

Assignee: jh+bugzilla → nobody
No longer blocks: build-android-p
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.