Loading packages/SystemUI/multivalentTests/src/com/android/systemui/haptics/qs/QSLongPressEffectTest.kt +0 −23 Original line number Original line Diff line number Diff line Loading @@ -274,29 +274,6 @@ class QSLongPressEffectTest : SysuiTestCase() { assertThat(couldClick).isFalse() assertThat(couldClick).isFalse() } } @Test fun onTileClick_whileIdle_withQSTile_clicks() = testWhileInState(QSLongPressEffect.State.IDLE) { // GIVEN that a click was detected val couldClick = longPressEffect.onTileClick() // THEN the click is successful assertThat(couldClick).isTrue() } @Test fun onTileClick_whileIdle_withoutQSTile_cannotClick() = testWhileInState(QSLongPressEffect.State.IDLE) { // GIVEN that no QSTile has been set longPressEffect.qsTile = null // GIVEN that a click was detected val couldClick = longPressEffect.onTileClick() // THEN the click is not successful assertThat(couldClick).isFalse() } private fun testWithScope(initialize: Boolean = true, test: suspend TestScope.() -> Unit) = private fun testWithScope(initialize: Boolean = true, test: suspend TestScope.() -> Unit) = with(kosmos) { with(kosmos) { testScope.runTest { testScope.runTest { Loading packages/SystemUI/src/com/android/systemui/haptics/qs/QSLongPressEffect.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -160,7 +160,7 @@ constructor( } } fun onTileClick(): Boolean { fun onTileClick(): Boolean { if (state == State.TIMEOUT_WAIT || state == State.IDLE) { if (state == State.TIMEOUT_WAIT) { setState(State.IDLE) setState(State.IDLE) qsTile?.let { qsTile?.let { it.click(expandable) it.click(expandable) Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/haptics/qs/QSLongPressEffectTest.kt +0 −23 Original line number Original line Diff line number Diff line Loading @@ -274,29 +274,6 @@ class QSLongPressEffectTest : SysuiTestCase() { assertThat(couldClick).isFalse() assertThat(couldClick).isFalse() } } @Test fun onTileClick_whileIdle_withQSTile_clicks() = testWhileInState(QSLongPressEffect.State.IDLE) { // GIVEN that a click was detected val couldClick = longPressEffect.onTileClick() // THEN the click is successful assertThat(couldClick).isTrue() } @Test fun onTileClick_whileIdle_withoutQSTile_cannotClick() = testWhileInState(QSLongPressEffect.State.IDLE) { // GIVEN that no QSTile has been set longPressEffect.qsTile = null // GIVEN that a click was detected val couldClick = longPressEffect.onTileClick() // THEN the click is not successful assertThat(couldClick).isFalse() } private fun testWithScope(initialize: Boolean = true, test: suspend TestScope.() -> Unit) = private fun testWithScope(initialize: Boolean = true, test: suspend TestScope.() -> Unit) = with(kosmos) { with(kosmos) { testScope.runTest { testScope.runTest { Loading
packages/SystemUI/src/com/android/systemui/haptics/qs/QSLongPressEffect.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -160,7 +160,7 @@ constructor( } } fun onTileClick(): Boolean { fun onTileClick(): Boolean { if (state == State.TIMEOUT_WAIT || state == State.IDLE) { if (state == State.TIMEOUT_WAIT) { setState(State.IDLE) setState(State.IDLE) qsTile?.let { qsTile?.let { it.click(expandable) it.click(expandable) Loading