[fenix] For https://github.com/mozilla-mobile/fenix/issues/15644: mock package inspec...
commitd821b7456b2e22b1670e2dc3020b4a93aff944da
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 14 Oct 2020 22:28:20 +0000 (14 15:28 -0700)
committerMichael Comella <mcomella@fastmail.com>
Thu, 15 Oct 2020 16:53:13 +0000 (15 09:53 -0700)
tree33d2105036b6573153b5571765d3593861e99dda
parent2d223f8651215782eac90044e29a4462add3f020
[fenix] For https://github.com/mozilla-mobile/fenix/issues/15644: mock package inspection dependencies in GleanMetricsService.

The new robolectric version changed the behavior such that the app ID
that was returned for our app was `org.mozilla.fenix.debug` instead of
(I guess) `org.mozilla.fenix`. In general, relying on robolectric can be
fragile, such as this case, so it's better to mock. Also, this test
behavior should theoretically have varied between build flavors so
mocking prevents the tests from breaking across flavors.
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt
mobile/android/fenix/app/src/test/java/org/mozilla/fenix/components/metrics/GleanMetricsServiceTest.kt