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

Commit a989c8f6 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Also skip test setup for tv-specific tests if not on tv"

parents 66c13d15 a2d28fd9
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -76,7 +76,14 @@ public abstract class ShellTestCase {
     * only be run on TVs.
     */
    protected void assumeTelevision() {
        assumeTrue(mPm.hasSystemFeature(PackageManager.FEATURE_LEANBACK)
                || mPm.hasSystemFeature(PackageManager.FEATURE_LEANBACK_ONLY));
        assumeTrue(isTelevision());
    }

    /**
     * Returns whether this test device is a TV device.
     */
    protected boolean isTelevision() {
        return mPm.hasSystemFeature(PackageManager.FEATURE_LEANBACK)
                || mPm.hasSystemFeature(PackageManager.FEATURE_LEANBACK_ONLY);
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -95,6 +95,9 @@ public class TvPipActionProviderTest extends ShellTestCase {

    @Before
    public void setUp() {
        if (!isTelevision()) {
            return;
        }
        MockitoAnnotations.initMocks(this);
        mActionsProvider = new TvPipActionsProvider(mContext, mMockPipMediaController,
                mMockSystemActionsHandler);
+3 −0
Original line number Diff line number Diff line
@@ -84,6 +84,9 @@ class TvPipBoundsControllerTest : ShellTestCase() {

    @Before
    fun setUp() {
        if (!isTelevision) {
            return
        }
        MockitoAnnotations.initMocks(this)
        time = 0L
        inMenu = false
+3 −0
Original line number Diff line number Diff line
@@ -48,6 +48,9 @@ public class TvPipGravityTest extends ShellTestCase {

    @Before
    public void setUp() {
        if (!isTelevision()) {
            return;
        }
        MockitoAnnotations.initMocks(this);
        mTvPipBoundsState = new TvPipBoundsState(mContext);
        mTvPipBoundsAlgorithm = new TvPipBoundsAlgorithm(mContext, mTvPipBoundsState,
+3 −0
Original line number Diff line number Diff line
@@ -56,6 +56,9 @@ class TvPipKeepClearAlgorithmTest : ShellTestCase() {

    @Before
    fun setup() {
        if (!isTelevision) {
            return
        }
        movementBounds = Rect(0, 0, SCREEN_SIZE.width, SCREEN_SIZE.height)
        movementBounds.inset(SCREEN_EDGE_INSET, SCREEN_EDGE_INSET)