Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 061c8e4d authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge changes from topic "flicker" am: db3931fe am: 3bc31d6b am:...

Merge changes from topic "flicker" am: db3931fe am: 3bc31d6b am: b00e2474 am: 123f65ba am: f19e8e6f

Change-Id: I5c33114243c336a67937e4c5a8b0b97dbc83921f
parents 850f890d f19e8e6f
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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))
+2 −1
Original line number Diff line number Diff line
@@ -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();
    }

+9 −25
Original line number Diff line number Diff line
@@ -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
@@ -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)