From 074a0ca5d375659a2e5420936513caf4ded30296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Ciche=C5=84ski?= Date: Wed, 8 Jun 2022 23:51:32 +0000 Subject: [PATCH] Update the assertion to get correct navigation mode value. Test: atest WMShellFlickerTests:PipRotationTest Bug: 206753786 Change-Id: Ie7ecaf1ca7df3055f270029fdfbb8c229a28ee7f --- .../server/wm/flicker/CommonAssertions.kt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt index 7f309e1974e14..8e69b2f9fe11c 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt @@ -20,8 +20,10 @@ package com.android.server.wm.flicker import com.android.server.wm.flicker.helpers.WindowUtils import com.android.server.wm.traces.common.FlickerComponentName -val LAUNCHER_COMPONENT = FlickerComponentName("com.google.android.apps.nexuslauncher", - "com.google.android.apps.nexuslauncher.NexusLauncherActivity") +val LAUNCHER_COMPONENT = FlickerComponentName( + "com.google.android.apps.nexuslauncher", + "com.google.android.apps.nexuslauncher.NexusLauncherActivity" +) /** * Checks that [FlickerComponentName.STATUS_BAR] window is visible and above the app windows in @@ -109,9 +111,9 @@ fun FlickerTestParameter.statusBarLayerIsVisible() { fun FlickerTestParameter.navBarLayerPositionStart() { assertLayersStart { 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) - .coversExactly(WindowUtils.getNavigationBarPosition(display)) + .coversExactly(WindowUtils.getNavigationBarPosition(display, isGesturalNavigation)) } } @@ -122,9 +124,9 @@ fun FlickerTestParameter.navBarLayerPositionStart() { fun FlickerTestParameter.navBarLayerPositionEnd() { assertLayersEnd { 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) - .coversExactly(WindowUtils.getNavigationBarPosition(display)) + .coversExactly(WindowUtils.getNavigationBarPosition(display, isGesturalNavigation)) } } @@ -216,11 +218,11 @@ fun FlickerTestParameter.replacesLayer( assertLayersStart { this.isVisible(originalLayer) - .isInvisible(newLayer) + .isInvisible(newLayer) } assertLayersEnd { this.isInvisible(originalLayer) - .isVisible(newLayer) + .isVisible(newLayer) } }