Loading packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/base/logging/QSTileLoggerTest.kt +4 −8 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ class QSTileLoggerTest : SysuiTestCase() { underTest.logUserActionPipeline( TileSpec.create("test_spec"), QSTileUserAction.Click(null), QSTileState.build({ Icon.Resource(0, ContentDescription.Resource(0)) }, "") {}, QSTileState.build(Icon.Resource(0, ContentDescription.Resource(0)), "") {}, "test_data", ) Loading @@ -141,7 +141,7 @@ class QSTileLoggerTest : SysuiTestCase() { fun testLogStateUpdate() { underTest.logStateUpdate( TileSpec.create("test_spec"), QSTileState.build({ Icon.Resource(0, ContentDescription.Resource(0)) }, "") {}, QSTileState.build(Icon.Resource(0, ContentDescription.Resource(0)), "") {}, "test_data", ) Loading @@ -162,18 +162,14 @@ class QSTileLoggerTest : SysuiTestCase() { @Test fun testLogForceUpdate() { underTest.logForceUpdate( TileSpec.create("test_spec"), ) underTest.logForceUpdate(TileSpec.create("test_spec")) assertThat(logBuffer.getStringBuffer()).contains("tile data force update") } @Test fun testLogInitialUpdate() { underTest.logInitialRequest( TileSpec.create("test_spec"), ) underTest.logInitialRequest(TileSpec.create("test_spec")) assertThat(logBuffer.getStringBuffer()).contains("tile data initial update") } Loading packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/base/viewmodel/QSTileViewModelImplTest.kt +3 −3 Original line number Diff line number Diff line Loading @@ -85,8 +85,8 @@ class QSTileViewModelImplTest : SysuiTestCase() { object : QSTileDataToStateMapper<Any> { override fun map(config: QSTileConfig, data: Any): QSTileState = QSTileState.build( { Icon.Resource(0, ContentDescription.Resource(0)) }, data.toString() Icon.Resource(0, ContentDescription.Resource(0)), data.toString(), ) {} } }, Loading Loading @@ -116,7 +116,7 @@ class QSTileViewModelImplTest : SysuiTestCase() { .isEqualTo( "test_spec:\n" + " QSTileState(" + "icon=() -> com.android.systemui.common.shared.model.Icon?, " + "icon=Resource(res=0, contentDescription=Resource(res=0)), " + "iconRes=null, " + "label=test_data, " + "activationState=INACTIVE, " + Loading packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/AirplaneModeMapperTest.kt +5 −5 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ class AirplaneModeMapperTest : SysuiTestCase() { createAirplaneModeState( QSTileState.ActivationState.ACTIVE, context.resources.getStringArray(R.array.tile_states_airplane)[Tile.STATE_ACTIVE], R.drawable.qs_airplane_icon_on R.drawable.qs_airplane_icon_on, ) QSTileStateSubject.assertThat(outputState).isEqualTo(expectedState) } Loading @@ -81,7 +81,7 @@ class AirplaneModeMapperTest : SysuiTestCase() { createAirplaneModeState( QSTileState.ActivationState.INACTIVE, context.resources.getStringArray(R.array.tile_states_airplane)[Tile.STATE_INACTIVE], R.drawable.qs_airplane_icon_off R.drawable.qs_airplane_icon_off, ) QSTileStateSubject.assertThat(outputState).isEqualTo(expectedState) } Loading @@ -89,11 +89,11 @@ class AirplaneModeMapperTest : SysuiTestCase() { private fun createAirplaneModeState( activationState: QSTileState.ActivationState, secondaryLabel: String, iconRes: Int iconRes: Int, ): QSTileState { val label = context.getString(R.string.airplane_mode) return QSTileState( { Icon.Loaded(context.getDrawable(iconRes)!!, null) }, Icon.Loaded(context.getDrawable(iconRes)!!, null), iconRes, label, activationState, Loading @@ -103,7 +103,7 @@ class AirplaneModeMapperTest : SysuiTestCase() { null, QSTileState.SideViewIcon.None, QSTileState.EnabledState.ENABLED, Switch::class.qualifiedName Switch::class.qualifiedName, ) } } packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/alarm/domain/AlarmTileMapperTest.kt +10 −10 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ class AlarmTileMapperTest : SysuiTestCase() { .apply { addOverride(R.drawable.ic_alarm, TestStubDrawable()) } .resources, context.theme, fakeClock fakeClock, ) } Loading @@ -69,7 +69,7 @@ class AlarmTileMapperTest : SysuiTestCase() { val expectedState = createAlarmTileState( QSTileState.ActivationState.INACTIVE, context.getString(R.string.qs_alarm_tile_no_alarm) context.getString(R.string.qs_alarm_tile_no_alarm), ) QSTileStateSubject.assertThat(outputState).isEqualTo(expectedState) } Loading @@ -85,7 +85,7 @@ class AlarmTileMapperTest : SysuiTestCase() { val localDateTime = LocalDateTime.ofInstant( Instant.ofEpochMilli(triggerTime), TimeZone.getDefault().toZoneId() TimeZone.getDefault().toZoneId(), ) val expectedSecondaryLabel = AlarmTileMapper.formatter24Hour.format(localDateTime) val expectedState = Loading @@ -104,7 +104,7 @@ class AlarmTileMapperTest : SysuiTestCase() { val localDateTime = LocalDateTime.ofInstant( Instant.ofEpochMilli(triggerTime), TimeZone.getDefault().toZoneId() TimeZone.getDefault().toZoneId(), ) val expectedSecondaryLabel = AlarmTileMapper.formatter12Hour.format(localDateTime) val expectedState = Loading @@ -124,7 +124,7 @@ class AlarmTileMapperTest : SysuiTestCase() { val localDateTime = LocalDateTime.ofInstant( Instant.ofEpochMilli(triggerTime), TimeZone.getDefault().toZoneId() TimeZone.getDefault().toZoneId(), ) val expectedSecondaryLabel = AlarmTileMapper.formatterDateOnly.format(localDateTime) val expectedState = Loading @@ -144,7 +144,7 @@ class AlarmTileMapperTest : SysuiTestCase() { val localDateTime = LocalDateTime.ofInstant( Instant.ofEpochMilli(triggerTime), TimeZone.getDefault().toZoneId() TimeZone.getDefault().toZoneId(), ) val expectedSecondaryLabel = AlarmTileMapper.formatter12Hour.format(localDateTime) val expectedState = Loading @@ -164,7 +164,7 @@ class AlarmTileMapperTest : SysuiTestCase() { val localDateTime = LocalDateTime.ofInstant( Instant.ofEpochMilli(triggerTime), TimeZone.getDefault().toZoneId() TimeZone.getDefault().toZoneId(), ) val expectedSecondaryLabel = AlarmTileMapper.formatterDateOnly.format(localDateTime) val expectedState = Loading @@ -174,11 +174,11 @@ class AlarmTileMapperTest : SysuiTestCase() { private fun createAlarmTileState( activationState: QSTileState.ActivationState, secondaryLabel: String secondaryLabel: String, ): QSTileState { val label = context.getString(R.string.status_bar_alarm) return QSTileState( { Icon.Loaded(context.getDrawable(R.drawable.ic_alarm)!!, null) }, Icon.Loaded(context.getDrawable(R.drawable.ic_alarm)!!, null), R.drawable.ic_alarm, label, activationState, Loading @@ -188,7 +188,7 @@ class AlarmTileMapperTest : SysuiTestCase() { null, QSTileState.SideViewIcon.Chevron, QSTileState.EnabledState.ENABLED, Switch::class.qualifiedName Switch::class.qualifiedName, ) } } packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/battery/ui/BatterySaverTileMapperTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -253,7 +253,7 @@ class BatterySaverTileMapperTest : SysuiTestCase() { ): QSTileState { val label = context.getString(R.string.battery_detail_switch_title) return QSTileState( { Icon.Loaded(context.getDrawable(iconRes)!!, null) }, Icon.Loaded(context.getDrawable(iconRes)!!, null), iconRes, label, activationState, Loading @@ -265,7 +265,7 @@ class BatterySaverTileMapperTest : SysuiTestCase() { stateDescription, QSTileState.SideViewIcon.None, QSTileState.EnabledState.ENABLED, Switch::class.qualifiedName Switch::class.qualifiedName, ) } } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/base/logging/QSTileLoggerTest.kt +4 −8 Original line number Diff line number Diff line Loading @@ -115,7 +115,7 @@ class QSTileLoggerTest : SysuiTestCase() { underTest.logUserActionPipeline( TileSpec.create("test_spec"), QSTileUserAction.Click(null), QSTileState.build({ Icon.Resource(0, ContentDescription.Resource(0)) }, "") {}, QSTileState.build(Icon.Resource(0, ContentDescription.Resource(0)), "") {}, "test_data", ) Loading @@ -141,7 +141,7 @@ class QSTileLoggerTest : SysuiTestCase() { fun testLogStateUpdate() { underTest.logStateUpdate( TileSpec.create("test_spec"), QSTileState.build({ Icon.Resource(0, ContentDescription.Resource(0)) }, "") {}, QSTileState.build(Icon.Resource(0, ContentDescription.Resource(0)), "") {}, "test_data", ) Loading @@ -162,18 +162,14 @@ class QSTileLoggerTest : SysuiTestCase() { @Test fun testLogForceUpdate() { underTest.logForceUpdate( TileSpec.create("test_spec"), ) underTest.logForceUpdate(TileSpec.create("test_spec")) assertThat(logBuffer.getStringBuffer()).contains("tile data force update") } @Test fun testLogInitialUpdate() { underTest.logInitialRequest( TileSpec.create("test_spec"), ) underTest.logInitialRequest(TileSpec.create("test_spec")) assertThat(logBuffer.getStringBuffer()).contains("tile data initial update") } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/base/viewmodel/QSTileViewModelImplTest.kt +3 −3 Original line number Diff line number Diff line Loading @@ -85,8 +85,8 @@ class QSTileViewModelImplTest : SysuiTestCase() { object : QSTileDataToStateMapper<Any> { override fun map(config: QSTileConfig, data: Any): QSTileState = QSTileState.build( { Icon.Resource(0, ContentDescription.Resource(0)) }, data.toString() Icon.Resource(0, ContentDescription.Resource(0)), data.toString(), ) {} } }, Loading Loading @@ -116,7 +116,7 @@ class QSTileViewModelImplTest : SysuiTestCase() { .isEqualTo( "test_spec:\n" + " QSTileState(" + "icon=() -> com.android.systemui.common.shared.model.Icon?, " + "icon=Resource(res=0, contentDescription=Resource(res=0)), " + "iconRes=null, " + "label=test_data, " + "activationState=INACTIVE, " + Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/AirplaneModeMapperTest.kt +5 −5 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ class AirplaneModeMapperTest : SysuiTestCase() { createAirplaneModeState( QSTileState.ActivationState.ACTIVE, context.resources.getStringArray(R.array.tile_states_airplane)[Tile.STATE_ACTIVE], R.drawable.qs_airplane_icon_on R.drawable.qs_airplane_icon_on, ) QSTileStateSubject.assertThat(outputState).isEqualTo(expectedState) } Loading @@ -81,7 +81,7 @@ class AirplaneModeMapperTest : SysuiTestCase() { createAirplaneModeState( QSTileState.ActivationState.INACTIVE, context.resources.getStringArray(R.array.tile_states_airplane)[Tile.STATE_INACTIVE], R.drawable.qs_airplane_icon_off R.drawable.qs_airplane_icon_off, ) QSTileStateSubject.assertThat(outputState).isEqualTo(expectedState) } Loading @@ -89,11 +89,11 @@ class AirplaneModeMapperTest : SysuiTestCase() { private fun createAirplaneModeState( activationState: QSTileState.ActivationState, secondaryLabel: String, iconRes: Int iconRes: Int, ): QSTileState { val label = context.getString(R.string.airplane_mode) return QSTileState( { Icon.Loaded(context.getDrawable(iconRes)!!, null) }, Icon.Loaded(context.getDrawable(iconRes)!!, null), iconRes, label, activationState, Loading @@ -103,7 +103,7 @@ class AirplaneModeMapperTest : SysuiTestCase() { null, QSTileState.SideViewIcon.None, QSTileState.EnabledState.ENABLED, Switch::class.qualifiedName Switch::class.qualifiedName, ) } }
packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/alarm/domain/AlarmTileMapperTest.kt +10 −10 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ class AlarmTileMapperTest : SysuiTestCase() { .apply { addOverride(R.drawable.ic_alarm, TestStubDrawable()) } .resources, context.theme, fakeClock fakeClock, ) } Loading @@ -69,7 +69,7 @@ class AlarmTileMapperTest : SysuiTestCase() { val expectedState = createAlarmTileState( QSTileState.ActivationState.INACTIVE, context.getString(R.string.qs_alarm_tile_no_alarm) context.getString(R.string.qs_alarm_tile_no_alarm), ) QSTileStateSubject.assertThat(outputState).isEqualTo(expectedState) } Loading @@ -85,7 +85,7 @@ class AlarmTileMapperTest : SysuiTestCase() { val localDateTime = LocalDateTime.ofInstant( Instant.ofEpochMilli(triggerTime), TimeZone.getDefault().toZoneId() TimeZone.getDefault().toZoneId(), ) val expectedSecondaryLabel = AlarmTileMapper.formatter24Hour.format(localDateTime) val expectedState = Loading @@ -104,7 +104,7 @@ class AlarmTileMapperTest : SysuiTestCase() { val localDateTime = LocalDateTime.ofInstant( Instant.ofEpochMilli(triggerTime), TimeZone.getDefault().toZoneId() TimeZone.getDefault().toZoneId(), ) val expectedSecondaryLabel = AlarmTileMapper.formatter12Hour.format(localDateTime) val expectedState = Loading @@ -124,7 +124,7 @@ class AlarmTileMapperTest : SysuiTestCase() { val localDateTime = LocalDateTime.ofInstant( Instant.ofEpochMilli(triggerTime), TimeZone.getDefault().toZoneId() TimeZone.getDefault().toZoneId(), ) val expectedSecondaryLabel = AlarmTileMapper.formatterDateOnly.format(localDateTime) val expectedState = Loading @@ -144,7 +144,7 @@ class AlarmTileMapperTest : SysuiTestCase() { val localDateTime = LocalDateTime.ofInstant( Instant.ofEpochMilli(triggerTime), TimeZone.getDefault().toZoneId() TimeZone.getDefault().toZoneId(), ) val expectedSecondaryLabel = AlarmTileMapper.formatter12Hour.format(localDateTime) val expectedState = Loading @@ -164,7 +164,7 @@ class AlarmTileMapperTest : SysuiTestCase() { val localDateTime = LocalDateTime.ofInstant( Instant.ofEpochMilli(triggerTime), TimeZone.getDefault().toZoneId() TimeZone.getDefault().toZoneId(), ) val expectedSecondaryLabel = AlarmTileMapper.formatterDateOnly.format(localDateTime) val expectedState = Loading @@ -174,11 +174,11 @@ class AlarmTileMapperTest : SysuiTestCase() { private fun createAlarmTileState( activationState: QSTileState.ActivationState, secondaryLabel: String secondaryLabel: String, ): QSTileState { val label = context.getString(R.string.status_bar_alarm) return QSTileState( { Icon.Loaded(context.getDrawable(R.drawable.ic_alarm)!!, null) }, Icon.Loaded(context.getDrawable(R.drawable.ic_alarm)!!, null), R.drawable.ic_alarm, label, activationState, Loading @@ -188,7 +188,7 @@ class AlarmTileMapperTest : SysuiTestCase() { null, QSTileState.SideViewIcon.Chevron, QSTileState.EnabledState.ENABLED, Switch::class.qualifiedName Switch::class.qualifiedName, ) } }
packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/battery/ui/BatterySaverTileMapperTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -253,7 +253,7 @@ class BatterySaverTileMapperTest : SysuiTestCase() { ): QSTileState { val label = context.getString(R.string.battery_detail_switch_title) return QSTileState( { Icon.Loaded(context.getDrawable(iconRes)!!, null) }, Icon.Loaded(context.getDrawable(iconRes)!!, null), iconRes, label, activationState, Loading @@ -265,7 +265,7 @@ class BatterySaverTileMapperTest : SysuiTestCase() { stateDescription, QSTileState.SideViewIcon.None, QSTileState.EnabledState.ENABLED, Switch::class.qualifiedName Switch::class.qualifiedName, ) } }