Merge "Only run legacy split flicker tests when it is using legacy split" into sc-v2-dev

This commit is contained in:
TreeHugger Robot
2021-08-19 07:19:39 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ package com.android.wm.shell.flicker.helpers
import android.app.Instrumentation
import android.content.ComponentName
import android.content.res.Resources
import com.android.wm.shell.flicker.testapp.Components
class SplitScreenHelper(
@@ -30,6 +31,11 @@ class SplitScreenHelper(
const val TEST_REPETITIONS = 1
const val TIMEOUT_MS = 3_000L
// TODO: remove all legacy split screen flicker tests when legacy split screen is fully
// deprecated.
fun isUsingLegacySplit(): Boolean =
Resources.getSystem().getBoolean(com.android.internal.R.bool.config_useLegacySplit)
fun getPrimary(instrumentation: Instrumentation): SplitScreenHelper =
SplitScreenHelper(instrumentation,
Components.SplitScreenActivity.LABEL,

View File

@@ -39,6 +39,7 @@ import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.setDevEn
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
import org.junit.After
import org.junit.Assume.assumeFalse
import org.junit.Assume.assumeTrue
import org.junit.Before
import org.junit.Test
@@ -56,6 +57,8 @@ abstract class LegacySplitScreenTransition(protected val testSpec: FlickerTestPa
@Before
open fun setup() {
// Only run legacy split tests when the system is using legacy split screen.
assumeTrue(SplitScreenHelper.isUsingLegacySplit())
// Legacy split is having some issue with Shell transition, and will be deprecated soon.
assumeFalse(isShellTransitionsEnabled())
prevDevEnableNonResizableMultiWindow = getDevEnableNonResizableMultiWindow(context)