Loading tests/FlickerTests/src/com/android/server/wm/flicker/CommonTransitions.java +6 −2 Original line number Diff line number Diff line Loading @@ -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)) Loading tests/FlickerTests/src/com/android/server/wm/flicker/DebugTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -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(); } Loading tests/FlickerTests/src/com/android/server/wm/flicker/OpenAppToSplitScreenTest.java +9 −25 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -69,25 +72,6 @@ public class OpenAppToSplitScreenTest extends FlickerTestBase { .forAllEntries()); } @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) Loading Loading
tests/FlickerTests/src/com/android/server/wm/flicker/CommonTransitions.java +6 −2 Original line number Diff line number Diff line Loading @@ -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)) Loading
tests/FlickerTests/src/com/android/server/wm/flicker/DebugTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -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(); } Loading
tests/FlickerTests/src/com/android/server/wm/flicker/OpenAppToSplitScreenTest.java +9 −25 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -69,25 +72,6 @@ public class OpenAppToSplitScreenTest extends FlickerTestBase { .forAllEntries()); } @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) Loading