Merge changes from topic "flicker" am: db3931fe93 am: 3bc31d6b34
Change-Id: Idb5519009b60c378960893aa072ba9d21ebc8db2
This commit is contained in:
@@ -175,11 +175,15 @@ class CommonTransitions {
|
|||||||
.repeat(ITERATIONS);
|
.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()
|
return TransitionRunner.newBuilder()
|
||||||
.withTag("appToSplitScreen_" + testApp.getLauncherName())
|
.withTag(testTag)
|
||||||
.recordAllRuns()
|
.recordAllRuns()
|
||||||
.runBeforeAll(AutomationUtils::wakeUpAndGoToHomeScreen)
|
.runBeforeAll(AutomationUtils::wakeUpAndGoToHomeScreen)
|
||||||
|
.runBeforeAll(() -> setRotation(device, beginRotation))
|
||||||
.runBefore(testApp::open)
|
.runBefore(testApp::open)
|
||||||
.runBefore(device::waitForIdle)
|
.runBefore(device::waitForIdle)
|
||||||
.runBefore(() -> sleep(500))
|
.runBefore(() -> sleep(500))
|
||||||
|
|||||||
@@ -94,7 +94,8 @@ public class DebugTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void openAppToSplitScreen() {
|
public void openAppToSplitScreen() {
|
||||||
CommonTransitions.appToSplitScreen(testApp, uiDevice).includeJankyRuns().recordAllRuns()
|
CommonTransitions.appToSplitScreen(testApp, uiDevice,
|
||||||
|
Surface.ROTATION_0).includeJankyRuns().recordAllRuns()
|
||||||
.build().run();
|
.build().run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,35 +17,38 @@
|
|||||||
package com.android.server.wm.flicker;
|
package com.android.server.wm.flicker;
|
||||||
|
|
||||||
import static com.android.server.wm.flicker.CommonTransitions.appToSplitScreen;
|
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.InstrumentationRegistry;
|
||||||
import androidx.test.filters.LargeTest;
|
import androidx.test.filters.LargeTest;
|
||||||
import androidx.test.runner.AndroidJUnit4;
|
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.FixMethodOrder;
|
import org.junit.FixMethodOrder;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.MethodSorters;
|
import org.junit.runners.MethodSorters;
|
||||||
|
import org.junit.runners.Parameterized;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test open app to split screen.
|
* Test open app to split screen.
|
||||||
* To run this test: {@code atest FlickerTests:OpenAppToSplitScreenTest}
|
* To run this test: {@code atest FlickerTests:OpenAppToSplitScreenTest}
|
||||||
*/
|
*/
|
||||||
@LargeTest
|
@LargeTest
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(Parameterized.class)
|
||||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
@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(),
|
this.mTestApp = new StandardAppHelper(InstrumentationRegistry.getInstrumentation(),
|
||||||
"com.android.server.wm.flicker.testapp", "SimpleApp");
|
"com.android.server.wm.flicker.testapp", "SimpleApp");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void runTransition() {
|
public void runTransition() {
|
||||||
super.runTransition(appToSplitScreen(mTestApp, mUiDevice).includeJankyRuns().build());
|
super.runTransition(appToSplitScreen(mTestApp, mUiDevice, mBeginRotation)
|
||||||
|
.includeJankyRuns()
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -69,25 +72,6 @@ public class OpenAppToSplitScreenTest extends FlickerTestBase {
|
|||||||
.forAllEntries());
|
.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
|
@Test
|
||||||
public void checkVisibility_dividerLayerBecomesVisible() {
|
public void checkVisibility_dividerLayerBecomesVisible() {
|
||||||
checkResults(result -> LayersTraceSubject.assertThat(result)
|
checkResults(result -> LayersTraceSubject.assertThat(result)
|
||||||
|
|||||||
Reference in New Issue
Block a user