Name Description Size
FenixRobolectricTestApplication.kt An override of our application for use in Robolectric-based unit tests. We're forced to override because our standard application fails to initialize in Robolectric with exceptions like: "Crash handler service must run in a separate process". 1696
FenixRobolectricTestRunner.kt A test runner that was added to start Robolectric with our custom configuration for use in unit tests. This class is now deprecated as the configuration is set by robolectric.properties instead. You should only use Robolectric when necessary because it non-trivially increases test duration. usage: ``` @RunWith(FenixRobolectricTestRunner::class) class ExampleUnitTest { ``` There were three common test runners before this patch: 1. The default (@RunWith not specified) = JUnit4 2. @RunWith(RobolectricTestRunner::class) = JUnit4 with support for the Android framework via Robolectric 3. @RunWith(AndroidJUnit4::class) = JUnit4 with support for the Android framework. This currently delegates to Robolectric but is presumably generically named so that it can support different implementations in the future. The name creates confusion on over the difference between this and JUnit without any Android support (1). We chose the name RobolectricTestRunner because we want folks to know they're starting Robolectric because it increases test runtime. Furthermore, the naming of 3) is unclear so we didn't want to use that name. As a result, new tests should use RobolectricTestRunner. 1639
LocaleTestRule.kt A JUnit [TestRule] that sets the default locale to a given [localeToSet] for the duration of the test and then resets it to the original locale. @param localeToSet The locale to set for the duration of the test. 1240
MockkRetryTestRule.kt [TestRule] to work around mockk problem that causes intermittent failures of tests with mocked lambdas. This rule will call `unmockAll` and retry running the failing test until [maxTries] is reached. See: https://github.com/mockk/mockk/issues/598 https://github.com/mozilla-mobile/fenix/issues/21952 https://github.com/mozilla-mobile/fenix/issues/22240 2556
perf
StackTraces.kt A collection of test helper functions for manipulating stack traces. 1814