From b91392d3b42c0b237681a5ce3af36fc7eaed3844 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 8 Jul 2022 19:02:59 +0000 Subject: [PATCH] Support running WMShellUnitTests from studio - Remove unnecessary @Presubmit annotation - Fix issue with test activity referencing wrong resources - Disable protolog requirement for tests when running under studio (like we do for SysUI studio builds) - Ensure all tests extend ShellTestCase Test: Run tests from studio, and also from atest WMShellUnitTests Bug: 238444377 Change-Id: I60a96dfcbbf119d6736e96193f5a7d41611e2fd1 --- libs/WindowManager/Shell/tests/unittest/Android.bp | 8 ++++++++ .../src/com/android/wm/shell/ShellTaskOrganizerTests.java | 2 +- .../unittest/src/com/android/wm/shell/ShellTestCase.java | 5 +++++ .../wm/shell/back/BackAnimationControllerTest.java | 3 ++- .../com/android/wm/shell/bubbles/BubblesTestActivity.java | 2 +- .../android/wm/shell/common/DisplayImeControllerTest.java | 3 ++- .../wm/shell/common/DisplayInsetsControllerTest.java | 3 ++- .../com/android/wm/shell/common/DisplayLayoutTest.java | 3 ++- .../wm/shell/common/TaskStackListenerImplTest.java | 4 +++- .../wm/shell/draganddrop/DragAndDropControllerTest.java | 3 ++- .../wm/shell/draganddrop/DragAndDropPolicyTest.java | 3 ++- .../HideDisplayCutoutControllerTest.java | 5 ++--- .../hidedisplaycutout/HideDisplayCutoutOrganizerTest.java | 5 ++--- .../wm/shell/kidsmode/KidsModeTaskOrganizerTest.java | 3 ++- .../com/android/wm/shell/onehanded/OneHandedTestCase.java | 4 +++- .../src/com/android/wm/shell/recents/SplitBoundsTest.java | 3 ++- .../shell/startingsurface/StartingSurfaceDrawerTests.java | 3 ++- .../wm/shell/startingsurface/TaskSnapshotWindowTest.java | 3 ++- .../TaskSurfaceHelperControllerTest.java | 5 ++--- .../android/wm/shell/transition/ShellTransitionTests.java | 3 ++- 20 files changed, 49 insertions(+), 24 deletions(-) diff --git a/libs/WindowManager/Shell/tests/unittest/Android.bp b/libs/WindowManager/Shell/tests/unittest/Android.bp index ea10be564351c..1a8b9540cbd0b 100644 --- a/libs/WindowManager/Shell/tests/unittest/Android.bp +++ b/libs/WindowManager/Shell/tests/unittest/Android.bp @@ -28,6 +28,9 @@ android_test { "**/*.java", "**/*.kt", ], + resource_dirs: [ + "res", + ], static_libs: [ "WindowManager-Shell", @@ -65,4 +68,9 @@ android_test { optimize: { enabled: false, }, + + aaptflags: [ + "--extra-packages", + "com.android.wm.shell.tests", + ], } diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java index 0b53c4069c3fa..65436a559b4f4 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java @@ -76,7 +76,7 @@ import java.util.Optional; */ @SmallTest @RunWith(AndroidJUnit4.class) -public class ShellTaskOrganizerTests { +public class ShellTaskOrganizerTests extends ShellTestCase { @Mock private ITaskOrganizerController mTaskOrganizerController; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTestCase.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTestCase.java index 403dbf9d9554a..b5ee037892ba9 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTestCase.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTestCase.java @@ -24,6 +24,8 @@ import android.testing.TestableContext; import androidx.test.platform.app.InstrumentationRegistry; +import com.android.internal.protolog.common.ProtoLog; + import org.junit.After; import org.junit.Before; import org.mockito.MockitoAnnotations; @@ -37,6 +39,9 @@ public abstract class ShellTestCase { @Before public void shellSetup() { + // Disable protolog tool when running the tests from studio + ProtoLog.REQUIRE_PROTOLOGTOOL = false; + MockitoAnnotations.initMocks(this); final Context context = InstrumentationRegistry.getInstrumentation().getTargetContext(); diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java index e7c5cb2183dbb..31e55e7116f03 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackAnimationControllerTest.java @@ -57,6 +57,7 @@ import androidx.test.filters.SmallTest; import androidx.test.platform.app.InstrumentationRegistry; import com.android.internal.util.test.FakeSettingsProvider; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.TestShellExecutor; import org.junit.Before; @@ -74,7 +75,7 @@ import org.mockito.MockitoAnnotations; @TestableLooper.RunWithLooper @SmallTest @RunWith(AndroidTestingRunner.class) -public class BackAnimationControllerTest { +public class BackAnimationControllerTest extends ShellTestCase { private static final String ANIMATION_ENABLED = "1"; private final TestShellExecutor mShellExecutor = new TestShellExecutor(); diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubblesTestActivity.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubblesTestActivity.java index d5fbe556045a6..0537d0ea24042 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubblesTestActivity.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubblesTestActivity.java @@ -20,7 +20,7 @@ import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import com.android.wm.shell.R; +import com.android.wm.shell.tests.R; /** * Referenced by NotificationTestHelper#makeBubbleMetadata diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java index b888450442637..587782cb79ad2 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java @@ -39,6 +39,7 @@ import android.view.SurfaceControl; import androidx.test.filters.SmallTest; import com.android.internal.view.IInputMethodManager; +import com.android.wm.shell.ShellTestCase; import org.junit.Before; import org.junit.Test; @@ -46,7 +47,7 @@ import org.junit.Test; import java.util.concurrent.Executor; @SmallTest -public class DisplayImeControllerTest { +public class DisplayImeControllerTest extends ShellTestCase { private SurfaceControl.Transaction mT; private DisplayImeController.PerDisplay mPerDisplay; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayInsetsControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayInsetsControllerTest.java index 3bf06cc0ede3b..3ef3a1f6a3ad4 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayInsetsControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayInsetsControllerTest.java @@ -34,6 +34,7 @@ import android.view.InsetsVisibilities; import androidx.test.filters.SmallTest; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.TestShellExecutor; import org.junit.Before; @@ -45,7 +46,7 @@ import org.mockito.MockitoAnnotations; import java.util.List; @SmallTest -public class DisplayInsetsControllerTest { +public class DisplayInsetsControllerTest extends ShellTestCase { private static final int SECOND_DISPLAY = DEFAULT_DISPLAY + 10; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayLayoutTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayLayoutTest.java index 0ffa5b35331db..514390fa52f9a 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayLayoutTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayLayoutTest.java @@ -41,6 +41,7 @@ import androidx.test.filters.SmallTest; import com.android.internal.R; import com.android.internal.policy.SystemBarUtils; +import com.android.wm.shell.ShellTestCase; import org.junit.After; import org.junit.Before; @@ -54,7 +55,7 @@ import org.mockito.MockitoSession; * atest WMShellUnitTests:DisplayLayoutTest */ @SmallTest -public class DisplayLayoutTest { +public class DisplayLayoutTest extends ShellTestCase { private MockitoSession mMockitoSession; @Before diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/TaskStackListenerImplTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/TaskStackListenerImplTest.java index 96938ebc27df9..1347e061eb458 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/TaskStackListenerImplTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/TaskStackListenerImplTest.java @@ -35,6 +35,8 @@ import android.window.TaskSnapshot; import androidx.test.filters.SmallTest; +import com.android.wm.shell.ShellTestCase; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -47,7 +49,7 @@ import org.mockito.MockitoAnnotations; @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper @SmallTest -public class TaskStackListenerImplTest { +public class TaskStackListenerImplTest extends ShellTestCase { @Mock private IActivityTaskManager mActivityTaskManager; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/draganddrop/DragAndDropControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/draganddrop/DragAndDropControllerTest.java index aaeebef03d0f2..0b43163787f37 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/draganddrop/DragAndDropControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/draganddrop/DragAndDropControllerTest.java @@ -44,6 +44,7 @@ import androidx.test.filters.SmallTest; import com.android.internal.logging.UiEventLogger; import com.android.launcher3.icons.IconProvider; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.common.DisplayController; import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.splitscreen.SplitScreenController; @@ -61,7 +62,7 @@ import java.util.Optional; */ @SmallTest @RunWith(AndroidJUnit4.class) -public class DragAndDropControllerTest { +public class DragAndDropControllerTest extends ShellTestCase { @Mock private Context mContext; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/draganddrop/DragAndDropPolicyTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/draganddrop/DragAndDropPolicyTest.java index 00617b1a3a3d1..9e988e8e8726b 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/draganddrop/DragAndDropPolicyTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/draganddrop/DragAndDropPolicyTest.java @@ -66,6 +66,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.SmallTest; import com.android.internal.logging.InstanceId; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.common.DisplayLayout; import com.android.wm.shell.draganddrop.DragAndDropPolicy.Target; import com.android.wm.shell.splitscreen.SplitScreenController; @@ -85,7 +86,7 @@ import java.util.HashSet; */ @SmallTest @RunWith(AndroidJUnit4.class) -public class DragAndDropPolicyTest { +public class DragAndDropPolicyTest extends ShellTestCase { @Mock private Context mContext; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/hidedisplaycutout/HideDisplayCutoutControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/hidedisplaycutout/HideDisplayCutoutControllerTest.java index b976c1287acac..7ecd5020d56ea 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/hidedisplaycutout/HideDisplayCutoutControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/hidedisplaycutout/HideDisplayCutoutControllerTest.java @@ -19,7 +19,6 @@ package com.android.wm.shell.hidedisplaycutout; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.verify; -import android.platform.test.annotations.Presubmit; import android.testing.AndroidTestingRunner; import android.testing.TestableContext; import android.testing.TestableLooper; @@ -27,6 +26,7 @@ import android.testing.TestableLooper; import androidx.test.filters.SmallTest; import androidx.test.platform.app.InstrumentationRegistry; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.common.ShellExecutor; import org.junit.Before; @@ -35,11 +35,10 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -@Presubmit @SmallTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper -public class HideDisplayCutoutControllerTest { +public class HideDisplayCutoutControllerTest extends ShellTestCase { private TestableContext mContext = new TestableContext( InstrumentationRegistry.getInstrumentation().getTargetContext(), null); diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/hidedisplaycutout/HideDisplayCutoutOrganizerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/hidedisplaycutout/HideDisplayCutoutOrganizerTest.java index 16e92395c85ef..49521cfbb34d5 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/hidedisplaycutout/HideDisplayCutoutOrganizerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/hidedisplaycutout/HideDisplayCutoutOrganizerTest.java @@ -32,7 +32,6 @@ import android.content.res.Configuration; import android.graphics.Insets; import android.graphics.Rect; import android.os.Binder; -import android.platform.test.annotations.Presubmit; import android.testing.AndroidTestingRunner; import android.testing.TestableContext; import android.testing.TestableLooper; @@ -48,6 +47,7 @@ import android.window.WindowContainerToken; import androidx.test.filters.SmallTest; import androidx.test.platform.app.InstrumentationRegistry; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.common.DisplayController; import com.android.wm.shell.common.DisplayLayout; import com.android.wm.shell.common.ShellExecutor; @@ -61,11 +61,10 @@ import org.mockito.MockitoAnnotations; import java.util.ArrayList; -@Presubmit @SmallTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper -public class HideDisplayCutoutOrganizerTest { +public class HideDisplayCutoutOrganizerTest extends ShellTestCase { private TestableContext mContext = new TestableContext( InstrumentationRegistry.getInstrumentation().getTargetContext(), null); diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/kidsmode/KidsModeTaskOrganizerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/kidsmode/KidsModeTaskOrganizerTest.java index 1eadeed7cd3be..184a8dfecff97 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/kidsmode/KidsModeTaskOrganizerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/kidsmode/KidsModeTaskOrganizerTest.java @@ -44,6 +44,7 @@ import android.window.WindowContainerTransaction; import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.SmallTest; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.common.DisplayController; import com.android.wm.shell.common.DisplayInsetsController; import com.android.wm.shell.common.ShellExecutor; @@ -61,7 +62,7 @@ import java.util.Optional; @SmallTest @RunWith(AndroidJUnit4.class) -public class KidsModeTaskOrganizerTest { +public class KidsModeTaskOrganizerTest extends ShellTestCase { @Mock private ITaskOrganizerController mTaskOrganizerController; @Mock private Context mContext; @Mock private Handler mHandler; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/onehanded/OneHandedTestCase.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/onehanded/OneHandedTestCase.java index 8b03dc58c3bf1..808ab2167dc77 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/onehanded/OneHandedTestCase.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/onehanded/OneHandedTestCase.java @@ -30,6 +30,8 @@ import android.view.WindowManager; import androidx.test.platform.app.InstrumentationRegistry; +import com.android.wm.shell.ShellTestCase; + import org.junit.Before; import org.junit.Rule; import org.mockito.Answers; @@ -38,7 +40,7 @@ import org.mockito.Mock; /** * Base class that does One Handed specific setup. */ -public abstract class OneHandedTestCase { +public abstract class OneHandedTestCase extends ShellTestCase { @Mock(answer = Answers.RETURNS_DEEP_STUBS) protected Context mContext; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/SplitBoundsTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/SplitBoundsTest.java index 068a60a12f5fb..50d02ae0dccd9 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/SplitBoundsTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/recents/SplitBoundsTest.java @@ -9,6 +9,7 @@ import android.graphics.Rect; import androidx.test.filters.SmallTest; import androidx.test.runner.AndroidJUnit4; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.util.SplitBounds; import org.junit.Before; @@ -17,7 +18,7 @@ import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) @SmallTest -public class SplitBoundsTest { +public class SplitBoundsTest extends ShellTestCase { private static final int DEVICE_WIDTH = 100; private static final int DEVICE_LENGTH = 200; private static final int DIVIDER_SIZE = 20; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java index 14d8ce4682c63..46b040fd43257 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/StartingSurfaceDrawerTests.java @@ -73,6 +73,7 @@ import androidx.test.filters.SmallTest; import androidx.test.platform.app.InstrumentationRegistry; import com.android.launcher3.icons.IconProvider; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.common.HandlerExecutor; import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.TransactionPool; @@ -91,7 +92,7 @@ import java.util.function.IntSupplier; */ @SmallTest @RunWith(AndroidJUnit4.class) -public class StartingSurfaceDrawerTests { +public class StartingSurfaceDrawerTests extends ShellTestCase { @Mock private IBinder mBinder; @Mock diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/TaskSnapshotWindowTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/TaskSnapshotWindowTest.java index 78e27c9568075..3de50bb604700 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/TaskSnapshotWindowTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/startingsurface/TaskSnapshotWindowTest.java @@ -47,6 +47,7 @@ import android.window.TaskSnapshot; import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.SmallTest; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.TestShellExecutor; import org.junit.Test; @@ -58,7 +59,7 @@ import org.junit.runner.RunWith; */ @SmallTest @RunWith(AndroidJUnit4.class) -public class TaskSnapshotWindowTest { +public class TaskSnapshotWindowTest extends ShellTestCase { private TaskSnapshotWindow mWindow; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/tasksurfacehelper/TaskSurfaceHelperControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/tasksurfacehelper/TaskSurfaceHelperControllerTest.java index d6142753b48a4..7583418fc018f 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/tasksurfacehelper/TaskSurfaceHelperControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/tasksurfacehelper/TaskSurfaceHelperControllerTest.java @@ -18,13 +18,13 @@ package com.android.wm.shell.tasksurfacehelper; import static org.mockito.Mockito.verify; -import android.platform.test.annotations.Presubmit; import android.testing.AndroidTestingRunner; import android.view.SurfaceControl; import androidx.test.filters.SmallTest; import com.android.wm.shell.ShellTaskOrganizer; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.common.ShellExecutor; import org.junit.Before; @@ -33,10 +33,9 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockitoAnnotations; -@Presubmit @RunWith(AndroidTestingRunner.class) @SmallTest -public class TaskSurfaceHelperControllerTest { +public class TaskSurfaceHelperControllerTest extends ShellTestCase { private TaskSurfaceHelperController mTaskSurfaceHelperController; @Mock private ShellTaskOrganizer mMockTaskOrganizer; diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java index a0b12976b467a..e2f2b71cea044 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/transition/ShellTransitionTests.java @@ -79,6 +79,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.SmallTest; import androidx.test.platform.app.InstrumentationRegistry; +import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.TestShellExecutor; import com.android.wm.shell.common.DisplayController; import com.android.wm.shell.common.ShellExecutor; @@ -98,7 +99,7 @@ import java.util.ArrayList; */ @SmallTest @RunWith(AndroidJUnit4.class) -public class ShellTransitionTests { +public class ShellTransitionTests extends ShellTestCase { private final WindowOrganizer mOrganizer = mock(WindowOrganizer.class); private final TransactionPool mTransactionPool = mock(TransactionPool.class);