diff options
author | Nataniel Borges <natanieljr@google.com> | 2020-02-04 12:00:44 +0100 |
---|---|---|
committer | Nataniel Borges <natanieljr@google.com> | 2020-02-25 12:55:20 +0100 |
commit | 68e0c874a3e241d90c380d596ebeca5230301822 (patch) | |
tree | 4c54a29a3b51533c81117bf742dff6513df15eff | |
parent | 6a087ec8eda342b13693ec696f0bb7a7f45c5f4c (diff) |
New flicker test: Add rotation to split screen test
Currently the split screen test only starts the app in 0 degrees. As the other tests, start in both 0 and 90 degrees to ensure animations work correctly.
Test: atest FlickerTests:OpenAppToSplitScreenTest
Change-Id: Ied316d9c48b243728544ad4a972cb3e0fa81bec8
3 files changed, 17 insertions, 28 deletions
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonTransitions.java b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonTransitions.java index a9228a239a25..0201a95b18bb 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonTransitions.java +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonTransitions.java @@ -175,11 +175,15 @@ class CommonTransitions { .repeat(ITERATIONS); } - static TransitionBuilder appToSplitScreen(IAppHelper testApp, UiDevice device) { + static TransitionBuilder appToSplitScreen(IAppHelper testApp, UiDevice device, + int beginRotation) { + final String testTag = "appToSplitScreen_" + testApp.getLauncherName() + "_" + + rotationToString(beginRotation); return TransitionRunner.newBuilder() - .withTag("appToSplitScreen_" + testApp.getLauncherName()) + .withTag(testTag) .recordAllRuns() .runBeforeAll(AutomationUtils::wakeUpAndGoToHomeScreen) + .runBeforeAll(() -> setRotation(device, beginRotation)) .runBefore(testApp::open) .runBefore(device::waitForIdle) .runBefore(() -> sleep(500)) diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/DebugTest.java b/tests/FlickerTests/src/com/android/server/wm/flicker/DebugTest.java index bf67e9db9955..666a0b9be779 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/DebugTest.java +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/DebugTest.java @@ -94,7 +94,8 @@ public class DebugTest { */ @Test public void openAppToSplitScreen() { - CommonTransitions.appToSplitScreen(testApp, uiDevice).includeJankyRuns().recordAllRuns() + CommonTransitions.appToSplitScreen(testApp, uiDevice, + Surface.ROTATION_0).includeJankyRuns().recordAllRuns() .build().run(); } diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/OpenAppToSplitScreenTest.java b/tests/FlickerTests/src/com/android/server/wm/flicker/OpenAppToSplitScreenTest.java index f8b7938901a8..ddead6d321a0 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/OpenAppToSplitScreenTest.java +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/OpenAppToSplitScreenTest.java @@ -17,35 +17,38 @@ package com.android.server.wm.flicker; import static com.android.server.wm.flicker.CommonTransitions.appToSplitScreen; -import static com.android.server.wm.flicker.WindowUtils.getDisplayBounds; import androidx.test.InstrumentationRegistry; import androidx.test.filters.LargeTest; -import androidx.test.runner.AndroidJUnit4; import org.junit.Before; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.MethodSorters; +import org.junit.runners.Parameterized; /** * Test open app to split screen. * To run this test: {@code atest FlickerTests:OpenAppToSplitScreenTest} */ @LargeTest -@RunWith(AndroidJUnit4.class) +@RunWith(Parameterized.class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -public class OpenAppToSplitScreenTest extends FlickerTestBase { +public class OpenAppToSplitScreenTest extends NonRotationTestBase { + + public OpenAppToSplitScreenTest(String beginRotationName, int beginRotation) { + super(beginRotationName, beginRotation); - public OpenAppToSplitScreenTest() { this.mTestApp = new StandardAppHelper(InstrumentationRegistry.getInstrumentation(), "com.android.server.wm.flicker.testapp", "SimpleApp"); } @Before public void runTransition() { - super.runTransition(appToSplitScreen(mTestApp, mUiDevice).includeJankyRuns().build()); + super.runTransition(appToSplitScreen(mTestApp, mUiDevice, mBeginRotation) + .includeJankyRuns() + .build()); } @Test @@ -70,25 +73,6 @@ public class OpenAppToSplitScreenTest extends FlickerTestBase { } @Test - public void checkCoveredRegion_noUncoveredRegions() { - checkResults(result -> - LayersTraceSubject.assertThat(result) - .coversRegion(getDisplayBounds()).forAllEntries()); - } - - @Test - public void checkVisibility_navBarLayerIsAlwaysVisible() { - checkResults(result -> LayersTraceSubject.assertThat(result) - .showsLayer(NAVIGATION_BAR_WINDOW_TITLE).forAllEntries()); - } - - @Test - public void checkVisibility_statusBarLayerIsAlwaysVisible() { - checkResults(result -> LayersTraceSubject.assertThat(result) - .showsLayer(STATUS_BAR_WINDOW_TITLE).forAllEntries()); - } - - @Test public void checkVisibility_dividerLayerBecomesVisible() { checkResults(result -> LayersTraceSubject.assertThat(result) .hidesLayer(DOCKED_STACK_DIVIDER) |