Spotless and disables V

Change-Id: Iaf1b7968a5a1b3c169afe7ea54800b4fb23c78ec
ja/edge-to-edge-dropshots
Jose Alcérreca 6 months ago
parent b2d0e0db88
commit 62b26ed5e1

@ -249,8 +249,11 @@ jobs:
profile: pixel_5
- api-level: 33
profile: pixel_fold
- api-level: "VanillaIceCream"
profile: pixel_fold
# Enable when a new version of the runner is released. Currently v2.30.1
# https://github.com/ReactiveCircus/android-emulator-runner/releases/tag/v2.30.1
# Also, change from VanillaIceCream to 35 when that image is available
# - api-level: VanillaIceCream
# profile: pixel_fold
steps:
- name: Delete unnecessary tools 🔧
@ -286,7 +289,7 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Build projects and run instrumentation tests including screenshots
- name: Build projects and run instrumented screenshot tests
id: dropshotsverify
continue-on-error: true
uses: reactivecircus/android-emulator-runner@v2
@ -306,7 +309,7 @@ jobs:
; echo "Done recording new screenshots, exiting with failure"
; exit 5
- name: Prevent pushing new screenshots if this is a fork (instrumented)
- name: Prevent pushing new screenshots if this is a fork
id: checkfork_screenshots_instrumented
continue-on-error: false
if: steps.dropshotsverify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository

@ -99,7 +99,7 @@ class EdgeToEdgeTest {
companion object {
@JvmStatic
@AfterClass
fun resetDemoMode(): Unit {
fun resetDemoMode() {
executeShellCommand("am broadcast -a com.android.systemui.demo -e command exit")
}
}
@ -130,19 +130,19 @@ class EdgeToEdgeTest {
private fun runFoldableTests(apiName: String) {
onDevice().setClosedMode()
screenshotSystemBar("edgeToEdge_Foldable_closed_system_${apiName}")
screenshotSystemBar("edgeToEdge_Foldable_closed_system_$apiName")
forceThreeButtonNavigation()
screenshotNavigationBar("edgeToEdge_Foldable_closed_nav3button_${apiName}")
screenshotNavigationBar("edgeToEdge_Foldable_closed_nav3button_$apiName")
forceGestureNavigation()
screenshotNavigationBar("edgeToEdge_Foldable_closed_navGesture_${apiName}")
screenshotNavigationBar("edgeToEdge_Foldable_closed_navGesture_$apiName")
onDevice().setFlatMode()
enableDemoMode() // Flat mode resets demo mode!
screenshotSystemBar("edgeToEdge_Foldable_flat_system_${apiName}")
screenshotSystemBar("edgeToEdge_Foldable_flat_system_$apiName")
forceThreeButtonNavigation()
screenshotNavigationBar("edgeToEdge_Foldable_flat_nav3button_${apiName}")
screenshotNavigationBar("edgeToEdge_Foldable_flat_nav3button_$apiName")
forceGestureNavigation()
screenshotNavigationBar("edgeToEdge_Foldable_flat_navGesture_${apiName}")
screenshotNavigationBar("edgeToEdge_Foldable_flat_navGesture_$apiName")
}
private fun screenshotSystemBar(screenshotFileName: String) {
@ -151,7 +151,8 @@ class EdgeToEdgeTest {
waitForWindowUpdate()
activityScenarioRule.scenario.onActivity { activity ->
topInset = activity.windowManager.maximumWindowMetrics.windowInsets.getInsets(
WindowInsets.Type.systemBars()).top
WindowInsets.Type.systemBars(),
).top
width = activity.windowManager.maximumWindowMetrics.bounds.width()
}
// Crop the top, adding extra pixels to check continuity
@ -168,7 +169,8 @@ class EdgeToEdgeTest {
waitForWindowUpdate()
activityScenarioRule.scenario.onActivity { activity ->
bottomInset = activity.windowManager.maximumWindowMetrics.windowInsets.getInsets(
WindowInsets.Type.navigationBars()).bottom
WindowInsets.Type.navigationBars(),
).bottom
width = activity.windowManager.maximumWindowMetrics.bounds.width()
height = activity.windowManager.maximumWindowMetrics.bounds.height()
}
@ -181,15 +183,19 @@ class EdgeToEdgeTest {
private fun forceThreeButtonNavigation() {
UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()).apply {
executeShellCommand("cmd overlay enable-exclusive " +
"com.android.internal.systemui.navbar.threebutton")
executeShellCommand(
"cmd overlay enable-exclusive " +
"com.android.internal.systemui.navbar.threebutton",
)
}
}
private fun forceGestureNavigation() {
UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()).apply {
executeShellCommand("cmd overlay enable-exclusive " +
"com.android.internal.systemui.navbar.gestural")
executeShellCommand(
"cmd overlay enable-exclusive " +
"com.android.internal.systemui.navbar.gestural",
)
}
}
@ -198,7 +204,7 @@ class EdgeToEdgeTest {
UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
.waitForWindowUpdate(
InstrumentationRegistry.getInstrumentation().targetContext.packageName,
4000
);
4000,
)
}
}

Loading…
Cancel
Save