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

Commit 1b1c43f2 authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Support Android TV

Replace TAPL dependency for LauncherStrategies which support different types of launcher.

Keep tapl as a dependency in the Android.bp file to comply with its guidelines and prevent READ_LOG exceptions.

Test: atest FlickerTests
Change-Id: I8fc073b19fd3308509cd79f169d5515ddf7d5b05
parent b8b5eb0f
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -17,14 +17,15 @@
package com.android.server.wm.flicker.helpers

import android.app.Instrumentation
import android.support.test.launcherhelper.ILauncherStrategy
import com.android.server.wm.flicker.StandardAppHelper

abstract class FlickerAppHelper(
    instr: Instrumentation,
    launcherName: String
) : StandardAppHelper(instr, sFlickerPackage, launcherName) {
    launcherName: String,
    launcherStrategy: ILauncherStrategy
) : StandardAppHelper(instr, sFlickerPackage, launcherName, launcherStrategy) {
    companion object {
        var sFindTimeout = 10000
        var sFlickerPackage = "com.android.server.wm.flicker.testapp"
    }
}
+7 −2
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.android.server.wm.flicker.helpers

import android.app.Instrumentation
import android.support.test.launcherhelper.ILauncherStrategy
import android.support.test.launcherhelper.LauncherStrategyFactory
import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.Until
@@ -24,8 +26,11 @@ import org.junit.Assert

open class ImeAppHelper(
    instr: Instrumentation,
    launcherName: String = "ImeApp"
) : FlickerAppHelper(instr, launcherName) {
    launcherName: String = "ImeApp",
    launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
            .getInstance(instr)
            .launcherStrategy
) : FlickerAppHelper(instr, launcherName, launcherStrategy) {
    open fun openIME(device: UiDevice) {
        val editText = device.wait(
                Until.findObject(By.res(getPackage(), "plain_text_input")),
+8 −1
Original line number Diff line number Diff line
@@ -17,11 +17,18 @@
package com.android.server.wm.flicker.helpers

import android.app.Instrumentation
import android.support.test.launcherhelper.ILauncherStrategy
import android.support.test.launcherhelper.LauncherStrategyFactory
import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice
import org.junit.Assert

class PipAppHelper(instr: Instrumentation) : FlickerAppHelper(instr, "PipApp") {
class PipAppHelper(
    instr: Instrumentation,
    launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
            .getInstance(instr)
            .launcherStrategy
) : FlickerAppHelper(instr, "PipApp", launcherStrategy) {
    fun clickEnterPipButton(device: UiDevice) {
        val enterPipButton = device.findObject(By.res(getPackage(), "enter_pip"))
        Assert.assertNotNull("Pip button not found, this usually happens when the device " +
+1 −2
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import com.android.server.wm.flicker.StandardAppHelper
import com.android.server.wm.flicker.helpers.WindowUtils
import com.android.server.wm.flicker.dsl.flicker
import com.android.server.wm.flicker.helpers.ImeAppHelper
import com.android.server.wm.flicker.helpers.clearRecents
import com.android.server.wm.flicker.helpers.exitSplitScreen
import com.android.server.wm.flicker.helpers.isInSplitScreen
import com.android.server.wm.flicker.helpers.launchSplitScreen
@@ -75,7 +74,7 @@ class ResizeSplitScreenTest : FlickerTestBase() {
                eachRun {
                    device.wakeUpAndGoToHomeScreen()
                    this.setRotation(rotation)
                    clearRecents(instrumentation)
                    this.launcherStrategy.clearRecentAppsFromOverview()
                    testAppBottom.open()
                    device.pressHome()
                    testAppTop.open()