Spotless and disables V

Change-Id: Iaf1b7968a5a1b3c169afe7ea54800b4fb23c78ec
ben/dropshots
Jose Alcérreca 1 year ago
parent a14b142ea5
commit a28d7e558b

@ -249,8 +249,11 @@ jobs:
profile: pixel_5 profile: pixel_5
- api-level: 33 - api-level: 33
profile: pixel_fold profile: pixel_fold
- api-level: "VanillaIceCream" # Enable when a new version of the runner is released. Currently v2.30.1
profile: pixel_fold # 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: steps:
- name: Delete unnecessary tools 🔧 - name: Delete unnecessary tools 🔧
@ -286,7 +289,7 @@ jobs:
- name: Setup Gradle - name: Setup Gradle
uses: gradle/gradle-build-action@v3 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 id: dropshotsverify
continue-on-error: true continue-on-error: true
uses: reactivecircus/android-emulator-runner@v2 uses: reactivecircus/android-emulator-runner@v2
@ -306,7 +309,7 @@ jobs:
; echo "Done recording new screenshots, exiting with failure" ; echo "Done recording new screenshots, exiting with failure"
; exit 5 ; 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 id: checkfork_screenshots_instrumented
continue-on-error: false continue-on-error: false
if: steps.dropshotsverify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository if: steps.dropshotsverify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository

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

Loading…
Cancel
Save