@@ -24,7 +24,6 @@ import com.ichi2.anki.settings.enums.ToolbarPosition
2424import org.junit.Test
2525import org.junit.runner.RunWith
2626import org.robolectric.ParameterizedRobolectricTestRunner
27- import org.robolectric.RuntimeEnvironment
2827
2928@RunWith(ParameterizedRobolectricTestRunner ::class )
3029class StudyScreenScreenshotTest (
@@ -35,7 +34,6 @@ class StudyScreenScreenshotTest(
3534 Prefs .toolbarPosition = config.toolbarPosition
3635 Prefs .showAnswerButtons = config.showAnswerButtons
3736 Prefs .frameStyle = config.frameStyle
38- RuntimeEnvironment .setQualifiers(config.qualifier.toString())
3937 }
4038
4139 @Test
@@ -64,27 +62,17 @@ class StudyScreenScreenshotTest(
6462 val styles = FrameStyle .entries
6563 // val styles = listOf(FrameStyle.BOX)
6664
67- val devices =
68- listOf (
69- Qualifier (" Phone" , 411 , 914 , " 420dpi" ),
70- Qualifier (" Tablet" , 1280 , 800 , " xhdpi" ),
71- )
72- // val devices = listOf(Qualifier("Phone", 411, 914, "420dpi"))
73-
7465 val configs = mutableListOf<Array <TestConfig >>()
7566 for (pos in positions) {
7667 for (btn in buttonStates) {
7768 for (style in styles) {
78- for (dev in devices) {
79- val config =
80- TestConfig (
81- pos,
82- btn,
83- style,
84- dev,
85- )
86- configs.add(arrayOf(config))
87- }
69+ val config =
70+ TestConfig (
71+ pos,
72+ btn,
73+ style,
74+ )
75+ configs.add(arrayOf(config))
8876 }
8977 }
9078 }
@@ -100,23 +88,9 @@ class StudyScreenScreenshotTest(
10088 val toolbarPosition : ToolbarPosition ,
10189 val showAnswerButtons : Boolean ,
10290 val frameStyle : FrameStyle ,
103- val qualifier : Qualifier ,
10491 ) {
10592 override fun toString (): String =
106- " ${qualifier.name} _toolbar =${toolbarPosition.name} _" +
93+ " toolbar =${toolbarPosition.name} _" +
10794 " frameStyle=${frameStyle.name} _buttons=$showAnswerButtons "
10895 }
10996}
110-
111- data class Qualifier (
112- val name : String ,
113- val widthDp : Int ,
114- val heightDp : Int ,
115- val dpi : String ,
116- val nightMode : Boolean = false ,
117- ) {
118- override fun toString (): String {
119- val nightString = if (nightMode) " night" else " notnight"
120- return " w${widthDp} dp-h${heightDp} dp-$nightString -$dpi "
121- }
122- }
0 commit comments