From 0451222aed0758ef946cb7ab1b2db304e2ca73c5 Mon Sep 17 00:00:00 2001 From: Sergey Nikolaienkov Date: Mon, 16 Nov 2020 13:24:58 +0000 Subject: [PATCH] Always run TV PiP tests with 0 rotation Bug: 13054136 Test: atest WMShellFlickerTests:TvPipMenuTests Test: atest WMShellFlickerTests:TvPipNotificationTests Change-Id: Ied62beb0c8551c8a0572455bd790c11c5517f61d --- .../wm/shell/flicker/pip/tv/TvPipMenuTests.kt | 12 +----------- .../shell/flicker/pip/tv/TvPipNotificationTests.kt | 11 +---------- .../android/wm/shell/flicker/pip/tv/TvPipTestBase.kt | 7 +------ 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/tv/TvPipMenuTests.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/tv/TvPipMenuTests.kt index 728cc510a79bc..680c7fab0e9b2 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/tv/TvPipMenuTests.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/tv/TvPipMenuTests.kt @@ -23,17 +23,13 @@ import com.android.wm.shell.flicker.wait import org.junit.Assert.assertTrue import org.junit.Before import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.Parameterized /** * Test Pip Menu on TV. * To run this test: `atest WMShellFlickerTests:TvPipMenuTests` */ @RequiresDevice -@RunWith(Parameterized::class) -class TvPipMenuTests(rotationName: String, rotation: Int) - : TvPipTestBase(rotationName, rotation) { +class TvPipMenuTests : TvPipTestBase() { private val systemUiResources = packageManager.getResourcesForApplication(SYSTEM_UI_PACKAGE_NAME) @@ -144,10 +140,4 @@ class TvPipMenuTests(rotationName: String, rotation: Int) uiDevice.pressWindowKey() return uiDevice.waitForTvPipMenu() ?: fail("Pip menu should have been shown") } - - companion object { - @Parameterized.Parameters(name = "{0}") - @JvmStatic - fun getParams(): Collection> = rotationParams - } } \ No newline at end of file diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/tv/TvPipNotificationTests.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/tv/TvPipNotificationTests.kt index 7a9b33b467425..75388bf2a189d 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/tv/TvPipNotificationTests.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/tv/TvPipNotificationTests.kt @@ -32,18 +32,13 @@ import org.junit.Assert.assertNull import org.junit.Assert.assertTrue import org.junit.Before import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.Parameterized /** * Test Pip Notifications on TV. * To run this test: `atest WMShellFlickerTests:TvPipNotificationTests` */ @RequiresDevice -@RunWith(Parameterized::class) -class TvPipNotificationTests(rotationName: String, rotation: Int) - : TvPipTestBase(rotationName, rotation) { - +class TvPipNotificationTests : TvPipTestBase() { @Before override fun setUp() { super.setUp() @@ -154,10 +149,6 @@ class TvPipNotificationTests(rotationName: String, rotation: Int) companion object { private const val TITLE_MEDIA_SESSION_PLAYING = "TestApp media is playing" private const val TITLE_MEDIA_SESSION_PAUSED = "TestApp media is paused" - - @Parameterized.Parameters(name = "{0}") - @JvmStatic - fun getParams(): Collection> = rotationParams } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/tv/TvPipTestBase.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/tv/TvPipTestBase.kt index d4acae50911b8..d1906ba2e27e5 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/tv/TvPipTestBase.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/tv/TvPipTestBase.kt @@ -32,8 +32,7 @@ import org.junit.Assert.assertFalse import org.junit.Assume import org.junit.Before -abstract class TvPipTestBase(rotationName: String, rotation: Int) - : PipTestBase(rotationName, rotation) { +abstract class TvPipTestBase : PipTestBase(rotationToString(ROTATION_0), ROTATION_0) { private val isTelevision: Boolean get() = packageManager.run { @@ -93,9 +92,5 @@ abstract class TvPipTestBase(rotationName: String, rotation: Int) companion object { private const val AFTER_TEXT_PROCESS_CHECK_DELAY = 1_000L // 1 sec - - @JvmStatic - protected val rotationParams: Collection> = - listOf(arrayOf(rotationToString(ROTATION_0), ROTATION_0)) } } \ No newline at end of file