Merge "Don't assert bars location when display is off" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c1655ef37d
@@ -102,13 +102,24 @@ fun FlickerTestParameter.statusBarLayerIsVisible() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun FlickerTestParameter.navBarLayerRotatesAndScales() {
|
/**
|
||||||
|
* Asserts that the [FlickerComponentName.NAV_BAR] layer is at the correct position at the start
|
||||||
|
* of the SF trace
|
||||||
|
*/
|
||||||
|
fun FlickerTestParameter.navBarLayerPositionStart() {
|
||||||
assertLayersStart {
|
assertLayersStart {
|
||||||
val display = this.entry.displays.minByOrNull { it.id }
|
val display = this.entry.displays.minByOrNull { it.id }
|
||||||
?: throw RuntimeException("There is no display!")
|
?: throw RuntimeException("There is no display!")
|
||||||
this.visibleRegion(FlickerComponentName.NAV_BAR)
|
this.visibleRegion(FlickerComponentName.NAV_BAR)
|
||||||
.coversExactly(WindowUtils.getNavigationBarPosition(display))
|
.coversExactly(WindowUtils.getNavigationBarPosition(display))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asserts that the [FlickerComponentName.NAV_BAR] layer is at the correct position at the end
|
||||||
|
* of the SF trace
|
||||||
|
*/
|
||||||
|
fun FlickerTestParameter.navBarLayerPositionEnd() {
|
||||||
assertLayersEnd {
|
assertLayersEnd {
|
||||||
val display = this.entry.displays.minByOrNull { it.id }
|
val display = this.entry.displays.minByOrNull { it.id }
|
||||||
?: throw RuntimeException("There is no display!")
|
?: throw RuntimeException("There is no display!")
|
||||||
@@ -117,13 +128,33 @@ fun FlickerTestParameter.navBarLayerRotatesAndScales() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun FlickerTestParameter.statusBarLayerRotatesScales() {
|
/**
|
||||||
|
* Asserts that the [FlickerComponentName.NAV_BAR] layer is at the correct position at the start
|
||||||
|
* and end of the SF trace
|
||||||
|
*/
|
||||||
|
fun FlickerTestParameter.navBarLayerRotatesAndScales() {
|
||||||
|
navBarLayerPositionStart()
|
||||||
|
navBarLayerPositionEnd()
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asserts that the [FlickerComponentName.STATUS_BAR] layer is at the correct position at the start
|
||||||
|
* of the SF trace
|
||||||
|
*/
|
||||||
|
fun FlickerTestParameter.statusBarLayerPositionStart() {
|
||||||
assertLayersStart {
|
assertLayersStart {
|
||||||
val display = this.entry.displays.minByOrNull { it.id }
|
val display = this.entry.displays.minByOrNull { it.id }
|
||||||
?: throw RuntimeException("There is no display!")
|
?: throw RuntimeException("There is no display!")
|
||||||
this.visibleRegion(FlickerComponentName.STATUS_BAR)
|
this.visibleRegion(FlickerComponentName.STATUS_BAR)
|
||||||
.coversExactly(WindowUtils.getStatusBarPosition(display))
|
.coversExactly(WindowUtils.getStatusBarPosition(display))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asserts that the [FlickerComponentName.STATUS_BAR] layer is at the correct position at the end
|
||||||
|
* of the SF trace
|
||||||
|
*/
|
||||||
|
fun FlickerTestParameter.statusBarLayerPositionEnd() {
|
||||||
assertLayersEnd {
|
assertLayersEnd {
|
||||||
val display = this.entry.displays.minByOrNull { it.id }
|
val display = this.entry.displays.minByOrNull { it.id }
|
||||||
?: throw RuntimeException("There is no display!")
|
?: throw RuntimeException("There is no display!")
|
||||||
@@ -132,6 +163,15 @@ fun FlickerTestParameter.statusBarLayerRotatesScales() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asserts that the [FlickerComponentName.STATUS_BAR] layer is at the correct position at the start
|
||||||
|
* and end of the SF trace
|
||||||
|
*/
|
||||||
|
fun FlickerTestParameter.statusBarLayerRotatesScales() {
|
||||||
|
statusBarLayerPositionStart()
|
||||||
|
statusBarLayerPositionEnd()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asserts that:
|
* Asserts that:
|
||||||
* [originalLayer] is visible at the start of the trace
|
* [originalLayer] is visible at the start of the trace
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ import org.junit.runners.Parameterized
|
|||||||
/**
|
/**
|
||||||
* Test cold launching an app from a notification from the lock screen.
|
* Test cold launching an app from a notification from the lock screen.
|
||||||
*
|
*
|
||||||
|
* This test assumes the device doesn't have AOD enabled
|
||||||
|
*
|
||||||
* To run this test: `atest FlickerTests:OpenAppFromLockNotificationCold`
|
* To run this test: `atest FlickerTests:OpenAppFromLockNotificationCold`
|
||||||
*/
|
*/
|
||||||
@RequiresDevice
|
@RequiresDevice
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ import org.junit.runners.Parameterized
|
|||||||
/**
|
/**
|
||||||
* Test warm launching an app from a notification from the lock screen.
|
* Test warm launching an app from a notification from the lock screen.
|
||||||
*
|
*
|
||||||
|
* This test assumes the device doesn't have AOD enabled
|
||||||
|
*
|
||||||
* To run this test: `atest FlickerTests:OpenAppFromLockNotificationWarm`
|
* To run this test: `atest FlickerTests:OpenAppFromLockNotificationWarm`
|
||||||
*/
|
*/
|
||||||
@RequiresDevice
|
@RequiresDevice
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import android.platform.test.annotations.Presubmit
|
|||||||
import androidx.test.filters.FlakyTest
|
import androidx.test.filters.FlakyTest
|
||||||
import com.android.server.wm.flicker.FlickerTestParameter
|
import com.android.server.wm.flicker.FlickerTestParameter
|
||||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||||
|
import com.android.server.wm.flicker.navBarLayerPositionEnd
|
||||||
import com.android.server.wm.traces.common.FlickerComponentName
|
import com.android.server.wm.traces.common.FlickerComponentName
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
@@ -99,4 +100,27 @@ abstract class OpenAppFromLockTransition(testSpec: FlickerTestParameter)
|
|||||||
@FlakyTest(bugId = 203538234)
|
@FlakyTest(bugId = 203538234)
|
||||||
@Test
|
@Test
|
||||||
override fun appWindowBecomesVisible() = super.appWindowBecomesVisible()
|
override fun appWindowBecomesVisible() = super.appWindowBecomesVisible()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks the position of the navigation bar at the start and end of the transition
|
||||||
|
*
|
||||||
|
* Differently from the normal usage of this assertion, check only the final state of the
|
||||||
|
* transition because the display is off at the start and the NavBar is never visible
|
||||||
|
*/
|
||||||
|
@Presubmit
|
||||||
|
@Test
|
||||||
|
override fun navBarLayerRotatesAndScales() = testSpec.navBarLayerPositionEnd()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks that the status bar layer is visible at the end of the trace
|
||||||
|
*
|
||||||
|
* It is not possible to check at the start because the screen is off
|
||||||
|
*/
|
||||||
|
@Presubmit
|
||||||
|
@Test
|
||||||
|
override fun statusBarLayerIsVisible() {
|
||||||
|
testSpec.assertLayersEnd {
|
||||||
|
this.isVisible(FlickerComponentName.STATUS_BAR)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ import org.junit.runners.Parameterized
|
|||||||
/**
|
/**
|
||||||
* Test cold launching an app from a notification.
|
* Test cold launching an app from a notification.
|
||||||
*
|
*
|
||||||
|
* This test assumes the device doesn't have AOD enabled
|
||||||
|
*
|
||||||
* To run this test: `atest FlickerTests:OpenAppFromNotificationCold`
|
* To run this test: `atest FlickerTests:OpenAppFromNotificationCold`
|
||||||
*/
|
*/
|
||||||
@RequiresDevice
|
@RequiresDevice
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ import org.junit.runners.Parameterized
|
|||||||
/**
|
/**
|
||||||
* Test cold launching an app from a notification.
|
* Test cold launching an app from a notification.
|
||||||
*
|
*
|
||||||
|
* This test assumes the device doesn't have AOD enabled
|
||||||
|
*
|
||||||
* To run this test: `atest FlickerTests:OpenAppFromNotificationWarm`
|
* To run this test: `atest FlickerTests:OpenAppFromNotificationWarm`
|
||||||
*/
|
*/
|
||||||
@RequiresDevice
|
@RequiresDevice
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.server.wm.flicker.launch
|
package com.android.server.wm.flicker.launch
|
||||||
|
|
||||||
|
import android.platform.test.annotations.Postsubmit
|
||||||
import androidx.test.filters.FlakyTest
|
import androidx.test.filters.FlakyTest
|
||||||
import android.platform.test.annotations.Presubmit
|
import android.platform.test.annotations.Presubmit
|
||||||
import android.platform.test.annotations.RequiresDevice
|
import android.platform.test.annotations.RequiresDevice
|
||||||
@@ -27,6 +28,7 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
|||||||
import com.android.server.wm.flicker.annotation.Group1
|
import com.android.server.wm.flicker.annotation.Group1
|
||||||
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
|
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
|
||||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||||
|
import com.android.server.wm.flicker.navBarLayerPositionEnd
|
||||||
import com.android.server.wm.traces.common.FlickerComponentName
|
import com.android.server.wm.traces.common.FlickerComponentName
|
||||||
import org.junit.FixMethodOrder
|
import org.junit.FixMethodOrder
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
@@ -37,6 +39,8 @@ import org.junit.runners.Parameterized
|
|||||||
/**
|
/**
|
||||||
* Test launching an app while the device is locked
|
* Test launching an app while the device is locked
|
||||||
*
|
*
|
||||||
|
* This test assumes the device doesn't have AOD enabled
|
||||||
|
*
|
||||||
* To run this test: `atest FlickerTests:OpenAppNonResizeableTest`
|
* To run this test: `atest FlickerTests:OpenAppNonResizeableTest`
|
||||||
*
|
*
|
||||||
* Actions:
|
* Actions:
|
||||||
@@ -103,8 +107,7 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter)
|
|||||||
/**
|
/**
|
||||||
* Checks that the status bar layer is visible at the end of the trace
|
* Checks that the status bar layer is visible at the end of the trace
|
||||||
*
|
*
|
||||||
* It is not possible to check at the start because the animation is working differently
|
* It is not possible to check at the start because the screen is off
|
||||||
* in devices with and without blur (b/202936526)
|
|
||||||
*/
|
*/
|
||||||
@Presubmit
|
@Presubmit
|
||||||
@Test
|
@Test
|
||||||
@@ -115,7 +118,7 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@FlakyTest(bugId = 202936526)
|
@FlakyTest(bugId = 206753786)
|
||||||
@Test
|
@Test
|
||||||
override fun statusBarLayerRotatesScales() = super.statusBarLayerRotatesScales()
|
override fun statusBarLayerRotatesScales() = super.statusBarLayerRotatesScales()
|
||||||
|
|
||||||
@@ -131,10 +134,15 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/**
|
||||||
@FlakyTest
|
* Checks the position of the navigation bar at the start and end of the transition
|
||||||
|
*
|
||||||
|
* Differently from the normal usage of this assertion, check only the final state of the
|
||||||
|
* transition because the display is off at the start and the NavBar is never visible
|
||||||
|
*/
|
||||||
|
@Postsubmit
|
||||||
@Test
|
@Test
|
||||||
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
|
override fun navBarLayerRotatesAndScales() = testSpec.navBarLayerPositionEnd()
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@FlakyTest
|
@FlakyTest
|
||||||
|
|||||||
Reference in New Issue
Block a user