For #15644: add comment for why we set the app theme in test.

upstream-sync
Michael Comella 4 years ago committed by Michael Comella
parent 4a000ab4f9
commit 439dfc5cb1

@ -17,7 +17,7 @@ class FenixRobolectricTestApplication : FenixApplication() {
override fun onCreate() {
super.onCreate()
setTheme(R.style.NormalTheme)
setApplicationTheme()
}
override val components = TestComponents(this)
@ -27,4 +27,14 @@ class FenixRobolectricTestApplication : FenixApplication() {
override fun setupInAllProcesses() = Unit
override fun setupInMainProcessOnly() = Unit
private fun setApplicationTheme() {
// According to the Robolectric devs, the application context will not have the <application>'s
// theme but will use the platform's default team so we set our theme here. We change it here
// rather than the production application because, upon testing, the production code appears
// appears to be working correctly. Context here:
// https://github.com/mozilla-mobile/fenix/pull/15646#issuecomment-707345798
// https://github.com/mozilla-mobile/fenix/pull/15646#issuecomment-709411141
setTheme(R.style.NormalTheme)
}
}

Loading…
Cancel
Save