diff options
17 files changed, 121 insertions, 39 deletions
diff --git a/core/tests/coretests/src/android/app/servertransaction/ClientTransactionTests.java b/core/tests/coretests/src/android/app/servertransaction/ClientTransactionTests.java index 52b26589279f..3d252fbddb80 100644 --- a/core/tests/coretests/src/android/app/servertransaction/ClientTransactionTests.java +++ b/core/tests/coretests/src/android/app/servertransaction/ClientTransactionTests.java @@ -30,6 +30,15 @@ import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; +/** + * Tests for {@link ClientTransaction}. + * + * <p>Build/Install/Run: + * atest FrameworksCoreTests:ClientTransactionTests + * + * <p>This test class is a part of Window Manager Service tests and specified in + * {@link com.android.server.wm.test.filters.FrameworksTestsFilter}. + */ @RunWith(AndroidJUnit4.class) @SmallTest @Presubmit diff --git a/core/tests/coretests/src/android/app/servertransaction/ObjectPoolTests.java b/core/tests/coretests/src/android/app/servertransaction/ObjectPoolTests.java index ad28d13dc46a..447f28e06d7e 100644 --- a/core/tests/coretests/src/android/app/servertransaction/ObjectPoolTests.java +++ b/core/tests/coretests/src/android/app/servertransaction/ObjectPoolTests.java @@ -42,6 +42,15 @@ import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; +/** + * Tests for {@link ObjectPool}. + * + * <p>Build/Install/Run: + * atest FrameworksCoreTests:ObjectPoolTests + * + * <p>This test class is a part of Window Manager Service tests and specified in + * {@link com.android.server.wm.test.filters.FrameworksTestsFilter}. + */ @RunWith(AndroidJUnit4.class) @SmallTest @Presubmit diff --git a/core/tests/coretests/src/android/app/servertransaction/TransactionExecutorTests.java b/core/tests/coretests/src/android/app/servertransaction/TransactionExecutorTests.java index f730a244a593..1cca79954138 100644 --- a/core/tests/coretests/src/android/app/servertransaction/TransactionExecutorTests.java +++ b/core/tests/coretests/src/android/app/servertransaction/TransactionExecutorTests.java @@ -26,9 +26,8 @@ import static android.app.servertransaction.ActivityLifecycleItem.ON_STOP; import static android.app.servertransaction.ActivityLifecycleItem.PRE_ON_CREATE; import static android.app.servertransaction.ActivityLifecycleItem.UNDEFINED; -import static junit.framework.Assert.assertEquals; - import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.inOrder; @@ -61,7 +60,15 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -/** Test {@link TransactionExecutor} logic. */ +/** + * Test {@link TransactionExecutor} logic. + * + * <p>Build/Install/Run: + * atest FrameworksCoreTests:TransactionExecutorTests + * + * <p>This test class is a part of Window Manager Service tests and specified in + * {@link com.android.server.wm.test.filters.FrameworksTestsFilter}. + */ @RunWith(AndroidJUnit4.class) @SmallTest @Presubmit diff --git a/core/tests/coretests/src/android/app/servertransaction/TransactionParcelTests.java b/core/tests/coretests/src/android/app/servertransaction/TransactionParcelTests.java index d73c174212bd..d117b4096ca0 100644 --- a/core/tests/coretests/src/android/app/servertransaction/TransactionParcelTests.java +++ b/core/tests/coretests/src/android/app/servertransaction/TransactionParcelTests.java @@ -21,8 +21,8 @@ import static android.app.servertransaction.TestUtils.mergedConfig; import static android.app.servertransaction.TestUtils.referrerIntentList; import static android.app.servertransaction.TestUtils.resultInfoList; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertTrue; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import android.app.IApplicationThread; import android.app.IInstrumentationWatcher; @@ -64,7 +64,15 @@ import org.junit.runner.RunWith; import java.util.List; import java.util.Map; -/** Test parcelling and unparcelling of transactions and transaction items. */ +/** + * Test parcelling and unparcelling of transactions and transaction items. + * + * <p>Build/Install/Run: + * atest FrameworksCoreTests:TransactionParcelTests + * + * <p>This test class is a part of Window Manager Service tests and specified in + * {@link com.android.server.wm.test.filters.FrameworksTestsFilter}. + */ @RunWith(AndroidJUnit4.class) @SmallTest @Presubmit diff --git a/core/tests/coretests/src/android/view/DisplayCutoutTest.java b/core/tests/coretests/src/android/view/DisplayCutoutTest.java index dd50af877bbb..182fe78dfa7a 100644 --- a/core/tests/coretests/src/android/view/DisplayCutoutTest.java +++ b/core/tests/coretests/src/android/view/DisplayCutoutTest.java @@ -44,6 +44,15 @@ import org.junit.runner.RunWith; import java.util.Arrays; import java.util.Collections; +/** + * Tests for {@link DisplayCutout}. + * + * <p>Build/Install/Run: + * atest FrameworksCoreTests:DisplayCutoutTest + * + * <p>This test class is a part of Window Manager Service tests and specified in + * {@link com.android.server.wm.test.filters.FrameworksTestsFilter}. + */ @RunWith(AndroidJUnit4.class) @SmallTest @Presubmit diff --git a/core/tests/coretests/src/android/view/InsetsAnimationControlImplTest.java b/core/tests/coretests/src/android/view/InsetsAnimationControlImplTest.java index 23ab05e952a3..ebbbdec7d376 100644 --- a/core/tests/coretests/src/android/view/InsetsAnimationControlImplTest.java +++ b/core/tests/coretests/src/android/view/InsetsAnimationControlImplTest.java @@ -18,18 +18,15 @@ package android.view; import static android.view.InsetsState.TYPE_NAVIGATION_BAR; import static android.view.InsetsState.TYPE_TOP_BAR; - import static android.view.ViewRootImpl.NEW_INSETS_MODE_FULL; import static android.view.WindowInsets.Type.sideBars; import static android.view.WindowInsets.Type.systemBars; -import static android.view.WindowInsets.Type.topBar; -import static junit.framework.Assert.assertEquals; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -55,6 +52,15 @@ import org.mockito.MockitoAnnotations; import java.util.List; +/** + * Tests for {@link InsetsAnimationControlImpl}. + * + * <p>Build/Install/Run: + * atest FrameworksCoreTests:InsetsAnimationControlImplTest + * + * <p>This test class is a part of Window Manager Service tests and specified in + * {@link com.android.server.wm.test.filters.FrameworksTestsFilter}. + */ @Presubmit @FlakyTest(detail = "Promote once confirmed non-flaky") @RunWith(AndroidJUnit4.class) diff --git a/core/tests/coretests/src/android/view/InsetsControllerTest.java b/core/tests/coretests/src/android/view/InsetsControllerTest.java index d71bde837d6f..4d8d3f68f875 100644 --- a/core/tests/coretests/src/android/view/InsetsControllerTest.java +++ b/core/tests/coretests/src/android/view/InsetsControllerTest.java @@ -19,13 +19,13 @@ package android.view; import static android.view.InsetsState.TYPE_IME; import static android.view.InsetsState.TYPE_NAVIGATION_BAR; import static android.view.InsetsState.TYPE_TOP_BAR; - import static android.view.WindowInsets.Type.topBar; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertFalse; -import static junit.framework.Assert.assertNull; -import static junit.framework.Assert.assertTrue; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.mock; @@ -53,6 +53,15 @@ import org.mockito.ArgumentCaptor; import java.util.concurrent.CountDownLatch; +/** + * Tests for {@link InsetsController}. + * + * <p>Build/Install/Run: + * atest FrameworksCoreTests:InsetsControllerTest + * + * <p>This test class is a part of Window Manager Service tests and specified in + * {@link com.android.server.wm.test.filters.FrameworksTestsFilter}. + */ @Presubmit @FlakyTest(detail = "Promote once confirmed non-flaky") @RunWith(AndroidJUnit4.class) diff --git a/core/tests/coretests/src/android/view/InsetsSourceConsumerTest.java b/core/tests/coretests/src/android/view/InsetsSourceConsumerTest.java index 4266ba9fe86e..a32fa778e736 100644 --- a/core/tests/coretests/src/android/view/InsetsSourceConsumerTest.java +++ b/core/tests/coretests/src/android/view/InsetsSourceConsumerTest.java @@ -43,6 +43,15 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockitoAnnotations; +/** + * Tests for {@link InsetsSourceConsumer}. + * + * <p>Build/Install/Run: + * atest FrameworksCoreTests:InsetsSourceConsumerTest + * + * <p>This test class is a part of Window Manager Service tests and specified in + * {@link com.android.server.wm.test.filters.FrameworksTestsFilter}. + */ @Presubmit @FlakyTest(detail = "Promote once confirmed non-flaky") @RunWith(AndroidJUnit4.class) diff --git a/core/tests/coretests/src/android/view/InsetsSourceTest.java b/core/tests/coretests/src/android/view/InsetsSourceTest.java index 98ab3e785d0a..b55a9c600a61 100644 --- a/core/tests/coretests/src/android/view/InsetsSourceTest.java +++ b/core/tests/coretests/src/android/view/InsetsSourceTest.java @@ -18,7 +18,7 @@ package android.view; import static android.view.InsetsState.TYPE_NAVIGATION_BAR; -import static junit.framework.Assert.assertEquals; +import static org.junit.Assert.assertEquals; import android.graphics.Insets; import android.graphics.Rect; @@ -31,6 +31,15 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +/** + * Tests for {@link InsetsSource}. + * + * <p>Build/Install/Run: + * atest FrameworksCoreTests:InsetsSourceTest + * + * <p>This test class is a part of Window Manager Service tests and specified in + * {@link com.android.server.wm.test.filters.FrameworksTestsFilter}. + */ @Presubmit @FlakyTest(detail = "Promote once confirmed non-flaky") @RunWith(AndroidJUnit4.class) diff --git a/core/tests/coretests/src/android/view/InsetsStateTest.java b/core/tests/coretests/src/android/view/InsetsStateTest.java index bd036b01c0cf..8e167da84e08 100644 --- a/core/tests/coretests/src/android/view/InsetsStateTest.java +++ b/core/tests/coretests/src/android/view/InsetsStateTest.java @@ -24,14 +24,13 @@ import static android.view.InsetsState.TYPE_SIDE_BAR_1; import static android.view.InsetsState.TYPE_SIDE_BAR_2; import static android.view.InsetsState.TYPE_SIDE_BAR_3; import static android.view.InsetsState.TYPE_TOP_BAR; - import static android.view.WindowInsets.Type.ime; import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertFalse; -import static junit.framework.Assert.assertTrue; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertTrue; import android.graphics.Insets; import android.graphics.Rect; @@ -47,6 +46,15 @@ import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; +/** + * Tests for {@link InsetsState}. + * + * <p>Build/Install/Run: + * atest FrameworksCoreTests:InsetsStateTest + * + * <p>This test class is a part of Window Manager Service tests and specified in + * {@link com.android.server.wm.test.filters.FrameworksTestsFilter}. + */ @Presubmit @FlakyTest(detail = "Promote once confirmed non-flaky") @RunWith(AndroidJUnit4.class) diff --git a/services/tests/wmtests/src/com/android/server/wm/AnimatingAppWindowTokenRegistryTest.java b/services/tests/wmtests/src/com/android/server/wm/AnimatingAppWindowTokenRegistryTest.java index febb79540fea..380f7c67402e 100644 --- a/services/tests/wmtests/src/com/android/server/wm/AnimatingAppWindowTokenRegistryTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/AnimatingAppWindowTokenRegistryTest.java @@ -22,12 +22,11 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify; import static com.android.dx.mockito.inline.extended.ExtendedMockito.verifyZeroInteractions; -import static junit.framework.Assert.assertFalse; -import static junit.framework.Assert.assertTrue; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import android.platform.test.annotations.Presubmit; -import androidx.test.filters.FlakyTest; import androidx.test.filters.SmallTest; import org.junit.Before; diff --git a/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java index 9bd993070939..b1ffbbd4ffba 100644 --- a/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java @@ -24,9 +24,9 @@ import static android.view.WindowManager.TRANSIT_TASK_CHANGE_WINDOWING_MODE; import static android.view.WindowManager.TRANSIT_TASK_CLOSE; import static android.view.WindowManager.TRANSIT_TASK_OPEN; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertFalse; -import static junit.framework.Assert.assertTrue; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import android.platform.test.annotations.Presubmit; import android.view.WindowManager; diff --git a/services/tests/wmtests/src/com/android/server/wm/PersisterQueueTests.java b/services/tests/wmtests/src/com/android/server/wm/PersisterQueueTests.java index a166444ce871..4e906bc9b6c3 100644 --- a/services/tests/wmtests/src/com/android/server/wm/PersisterQueueTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/PersisterQueueTests.java @@ -18,11 +18,10 @@ package com.android.server.wm; import static com.google.common.truth.Truth.assertWithMessage; -import static junit.framework.Assert.assertNull; -import static junit.framework.Assert.assertSame; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import android.os.SystemClock; diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotCacheTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotCacheTest.java index 1c6afd545b1f..3bedabc45c00 100644 --- a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotCacheTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotCacheTest.java @@ -18,8 +18,8 @@ package com.android.server.wm; import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW; -import static junit.framework.Assert.assertNotNull; -import static junit.framework.Assert.assertNull; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import android.platform.test.annotations.Presubmit; diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotControllerTest.java index 792e8a6f7582..113f3c8e237c 100644 --- a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotControllerTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotControllerTest.java @@ -23,7 +23,7 @@ import static android.view.WindowManager.TRANSIT_UNSET; import static com.android.server.wm.TaskSnapshotController.SNAPSHOT_MODE_APP_THEME; import static com.android.server.wm.TaskSnapshotController.SNAPSHOT_MODE_REAL; -import static junit.framework.Assert.assertEquals; +import static org.junit.Assert.assertEquals; import android.platform.test.annotations.Presubmit; import android.util.ArraySet; diff --git a/services/tests/wmtests/src/com/android/server/wm/UnknownAppVisibilityControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/UnknownAppVisibilityControllerTest.java index 8854edef9994..a91daf0c7647 100644 --- a/services/tests/wmtests/src/com/android/server/wm/UnknownAppVisibilityControllerTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/UnknownAppVisibilityControllerTest.java @@ -16,9 +16,8 @@ package com.android.server.wm; -import static junit.framework.Assert.assertTrue; +import static org.junit.Assert.assertTrue; -import android.os.SystemClock; import android.platform.test.annotations.Presubmit; import androidx.test.filters.SmallTest; diff --git a/tests/utils/testutils/java/com/android/server/wm/test/filters/CoreTestsFilter.java b/tests/utils/testutils/java/com/android/server/wm/test/filters/FrameworksTestsFilter.java index 1a81c2c9fd41..e0d74e0908ee 100644 --- a/tests/utils/testutils/java/com/android/server/wm/test/filters/CoreTestsFilter.java +++ b/tests/utils/testutils/java/com/android/server/wm/test/filters/FrameworksTestsFilter.java @@ -26,23 +26,25 @@ import com.android.test.filters.SelectTest; * <p>Use this filter when running FrameworksCoreTests as * <pre> * adb shell am instrument -w \ - * -e filter com.android.server.wm.test.filters.CoreTestsFilter \ + * -e filter com.android.server.wm.test.filters.FrameworksTestsFilter \ * -e selectTest_verbose true \ * com.android.frameworks.coretests/androidx.test.runner.AndroidJUnitRunner * </pre> */ -public final class CoreTestsFilter extends SelectTest { +public final class FrameworksTestsFilter extends SelectTest { - private static final String[] SELECTED_CORE_TESTS = { + private static final String[] SELECTED_TESTS = { + // Test specifications for FrameworksCoreTests. "android.app.servertransaction.", // all tests under the package. "android.view.DisplayCutoutTest", + "android.view.InsetsAnimationControlImplTest", "android.view.InsetsControllerTest", "android.view.InsetsSourceTest", "android.view.InsetsSourceConsumerTest", "android.view.InsetsStateTest", }; - public CoreTestsFilter(Bundle testArgs) { - super(addSelectTest(testArgs, SELECTED_CORE_TESTS)); + public FrameworksTestsFilter(Bundle testArgs) { + super(addSelectTest(testArgs, SELECTED_TESTS)); } } |